-
Notifications
You must be signed in to change notification settings - Fork 17
79 lines (64 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
name: Release
on:
push:
branches:
- pre-release
- master
- develop
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: '18'
- name: Install dependencies
run: yarn install
- name: Set TARGET_BROWSER environment variable
run: echo "TARGET_BROWSER=chrome" >> $GITHUB_ENV
- name: Build project for Chrome
run: yarn run build:chrome
- name: Build project for Canary
run: yarn run build:canary
- name: List files in build directory
run: ls -l ./build
- name: Set asset name for Chrome
id: set_asset_name_chrome
run: echo "ASSET_NAME_CHROME=$(ls build | grep 'pali-wallet-' | grep 'chrome' | grep '.zip' | grep -v 'canary')" >> $GITHUB_ENV
- name: Set asset name for Canary
id: set_asset_name_canary
run: echo "ASSET_NAME_CANARY=$(ls build | grep 'pali-wallet-' | grep 'chrome' | grep 'canary' | grep '.zip')" >> $GITHUB_ENV
- name: Get package version
id: get_version
run: echo "PACKAGE_VERSION=$(cat package.json | jq -r '.version')" >> $GITHUB_ENV
- name: Create a draft release
id: create_release
uses: actions/create-release@v1
with:
tag_name: v${{ github.event.repository.name }}-${{ github.ref_name }}-release
release_name: Release ${{ github.event.repository.name }} for ${{ github.ref_name }} (v${{ env.PACKAGE_VERSION }})
draft: true
prerelease: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload Chrome zip to release
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./build/${{ env.ASSET_NAME_CHROME }}
asset_name: ${{ env.ASSET_NAME_CHROME }}
asset_content_type: application/zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload Canary zip to release
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./build/${{ env.ASSET_NAME_CANARY }}
asset_name: ${{ env.ASSET_NAME_CANARY }}
asset_content_type: application/zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}