-
Notifications
You must be signed in to change notification settings - Fork 0
92 lines (77 loc) · 2.46 KB
/
release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
name: "Release workflow"
on:
push:
branches: ["main"]
jobs:
build:
if: github.event.commits[0].author.name != 'Automation User'
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x]
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Configure git
run: |
git config user.name 'Automation User'
git config user.email '<>'
- name: package.json version patch
id: version-patch
run: |
npm version patch
result=$(npx dot-json@1 package.json version)
echo "version=${result}" >> $GITHUB_OUTPUT
shell: bash
- name: manifest.json version patch
run: |
npx dot-json@1 ./public/manifest.json version "${{ steps.version-patch.outputs.version }}"
- name: Git Push diff
run: |
git add .
git commit --amend --no-edit
git push origin HEAD
git push --tags
shell: bash
- name: Build extension
run: |
npm i --force
npm run build-game:ext
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: build-v{{steps.version-patch.outputs.version}}
path: dist_ext/
- name: Download artifact
uses: actions/download-artifact@v4
with:
name: build-v{{steps.version-patch.outputs.version}}
- name: Test artifact download
run: ls -R
- name: Archive build
uses: thedoctor0/zip-release@0.7.5
with:
type: 'zip'
path: ./dist_ext
filename: release-v{{steps.version-patch.outputs.version}}.zip
exclusions: '*.git* /*node_modules/* .editorconfig'
- name: Create GitHub release
id: create-release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.version-patch.outputs.version }}
release_name: Release v${{ steps.version-patch.outputs.version }}
- name: Upload GitHub release asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create-release.outputs.upload_url }}
asset_path: ./release-v{{steps.version-patch.outputs.version}}.zip
asset_name: game-ext-v${{steps.version-patch.outputs.version}}.zip
asset_content_type: application/zip