forked from MyEtherWallet/MyEtherWallet
-
Notifications
You must be signed in to change notification settings - Fork 0
70 lines (57 loc) · 2.72 KB
/
github-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
name: create github release [v6]
on:
push:
tags:
- 'v6.*'
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
ref: main
- name: verify tag
run: |
git branch --contains $GITHUB_SHA | sed -e 's/^[ \t *]*//' | grep '^main$'
git checkout $GITHUB_SHA
- name: setup env
id: node-version
run: |
docker build -t mew-build-container .
echo ::set-output name=NODE_VERSION::$(docker run --rm -v `pwd`:/home:rw mew-build-container /bin/bash -c "node --version")
- name: Cache node modules
uses: actions/cache@v2
with:
path: node_modules
key: ${{ runner.os }}-node-${{steps.node-version.outputs.NODE_VERSION}}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-${{steps.node-version.outputs.NODE_VERSION}}-
- name: npm install
run: docker run --rm -v `pwd`:/home:rw --user "$(id -u):$(id -g)" mew-build-container /bin/bash -c "npm install"
- name: Get release tag
id: get_release_tag
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
- name: setup gpg keys
run: |
openssl aes-256-cbc -K ${{secrets.FILE_DECRYPT_KEY}} -iv ${{secrets.FILE_DECRYPT_IV}} -in ssh-keys.tar.enc -out ssh-keys.tar -d
tar xvf ssh-keys.tar
gpg --allow-secret-key-import --import mew-sign.gpg
mkdir release
- name: build
run: |
docker run -e INTERCOM_ID="${{secrets.INTERCOM_ID}}" -e WALLET_CONNECT_PROJECT_ID="${{secrets.WALLET_CONNECT_PROJECT_ID}}" --rm -v `pwd`:/home:rw mew-build-container /bin/bash -c "npm run build"
cd dist && zip -r ../release/MyEtherWallet-${{ steps.get_release_tag.outputs.VERSION }}.zip * && cd ..
- name: build hash
run: |
docker run -e INTERCOM_ID="${{secrets.INTERCOM_ID}}" -e WALLET_CONNECT_PROJECT_ID="${{secrets.WALLET_CONNECT_PROJECT_ID}}" --rm -v `pwd`:/home:rw mew-build-container /bin/bash -c "npm run build:nohash"
cd dist && zip -r ../release/MyEtherWallet-${{ steps.get_release_tag.outputs.VERSION }}-Hash.zip * && cd ..
- name: build offline
run: |
docker run --rm -v `pwd`:/home:rw mew-build-container /bin/bash -c "npm run build:offline"
cd dist && zip -r ../release/MyEtherWallet-${{ steps.get_release_tag.outputs.VERSION }}-Offline.zip * && cd ..
- name: sign files
run: bash ./scripts/signFiles.sh
- name: create release
env:
GITHUB_TOKEN: ${{secrets.MEW_BOT_TOKEN}}
run: bash ./scripts/release.sh ${{ steps.get_release_tag.outputs.VERSION }} $GITHUB_TOKEN $GITHUB_REPOSITORY