Skip to content

Commit d2b3622

Browse files
author
dada513
authored
Create release.yml
1 parent 6688bef commit d2b3622

1 file changed

Lines changed: 54 additions & 0 deletions

File tree

.github/workflows/release.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: Release workflow
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
build:
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- uses: actions/checkout@v2
13+
14+
- name: Use Node.js 16
15+
uses: actions/setup-node@v1
16+
with:
17+
node-version: 16
18+
19+
- name: Cache
20+
uses: actions/cache@v2.1.7
21+
with:
22+
# A list of files, directories, and wildcard patterns to cache and restore
23+
path: |
24+
node_modules/
25+
out/
26+
yarn.lock
27+
# An explicit key for restoring and saving the cache
28+
key: cache1
29+
30+
- name: Build
31+
run: |
32+
yarn
33+
yarn build
34+
35+
- run: |
36+
upload_url=$(curl -sL https://api.github.com/repos/StopModReposts/Extension/releases/latest | jq -r '.upload_url')
37+
echo UPLOAD_URL=$upload_url >> $GITHUB_ENV
38+
39+
- name: get extension filename
40+
id: extzip
41+
run: |
42+
files=(./web-ext-artifacts/*)
43+
echo EXT_ARTIFACT_PATH=$files >> $GITHUB_ENV
44+
cd web-ext-artifacts
45+
files2=(*)
46+
echo EXT_ARTIFACT_NAME=$files2 >> $GITHUB_ENV
47+
48+
- name: Upload release artifacts
49+
uses: actions/upload-release-asset@v1
50+
with:
51+
upload_url: ${{ env.UPLOAD_URL }}
52+
asset_path: ${{ env.EXT_ARTIFACT_PATH }}
53+
asset_name: ${{ env.EXT_ARTIFACT_NAME }}
54+
asset_content_type: application/zip

0 commit comments

Comments
 (0)