-
Notifications
You must be signed in to change notification settings - Fork 3
211 lines (188 loc) · 7.21 KB
/
release.yaml
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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
name: Concordium desktop wallet release
on:
workflow_dispatch:
inputs:
service:
type: choice
description: Choose which workflow should be ran
options:
- desktop-wallet-windows
- release-desktop-wallet-linux
push:
branches:
- ekw/SRE-1001/release-desktop-wallet
tags:
- desktop-wallet-*/*
env:
BASE_IMAGE_VERSION: "rust-1.74.1_ghc-9.6.4"
TARGET_NET: "stagenet"
NODE_VERSION: "16.20.2"
STATIC_NODE_BINARY_IMAGE_NAME: 'static-node-binaries'
AWS_ROLE_TO_ASSUME: "arn:aws:iam::192549843005:role/github_concordium-desktop-wallet"
S3_BUCKET: "s3://desktopwallet.concordium.com/"
ECR_REPO: "192549843005.dkr.ecr.eu-west-1.amazonaws.com/concordium/desktop-wallet-ci"
permissions:
id-token: write
contents: read
jobs:
login-aws:
runs-on: ubuntu-latest
outputs:
access_key: ${{ steps.login-ecr.outputs.docker_username_192549843005_dkr_ecr_eu_west_1_amazonaws_com }}
secret_key: ${{ steps.login-ecr.outputs.docker_password_192549843005_dkr_ecr_eu_west_1_amazonaws_com }}
environment: release
steps:
- name: aws creds
uses: aws-actions/configure-aws-credentials@v4
id: creds
with:
aws-region: "eu-west-1"
role-to-assume: ${{ env.AWS_ROLE_TO_ASSUME }}
role-session-name: ReleaseDesktopWalletSession
mask-aws-account-id: false
- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v2
with:
mask-password: false
- name: Check if image exist
run: |
aws ecr describe-images --registry-id "192549843005" --repository-name "concordium/desktop-wallet-ci" --region eu-west-1 --image-ids=imageTag=test
echo "EC=$?" >> $GITHUB_ENV
- name: Checkout repository
if: ${{ env.EC == 254 }}
uses: actions/checkout@v4
with:
submodules: recursive
ref: ${{ github.ref_name }}
- name: build ci image
if: ${{ env.EC == 254 }}
uses: docker/build-push-action@v6
with:
push: true
tags: "192549843005.dkr.ecr.eu-west-1.amazonaws.com/concordium/desktop-wallet-ci:test"
context: '.'
file: 'scripts/desktop-wallet-ci.Dockerfile'
build-args: |
BASE_VERSION=${{ env.BASE_IMAGE_VERSION }}
NODE_VERSION=${{ env.NODE_VERSION }}
# release-desktop-wallet-linux:
# environment: release
# needs: login-aws
# runs-on: ubuntu-latest
# container:
# image: "192549843005.dkr.ecr.eu-west-1.amazonaws.com/concordium/desktop-wallet-ci:test"
# credentials:
# username: ${{needs.login-aws.outputs.access_key}}
# password: ${{needs.login-aws.outputs.secret_key}}
# options: -u root
# steps:
# - name: Checkout repository
# uses: actions/checkout@v4
# with:
# submodules: recursive
# ref: ${{ github.ref_name }}
#
# - name: Install dependencies and build
# run: |
# rustup default stable
# node --version
# npm --version
# yarn --version
# python --version
# rustup show
# wasm-pack --version
#
# yarn
# yarn package
#
# - name: publish
# run: |
# # Extract version number
# VERSION=$(awk '/"version":/ { print substr($2, 2, length($2)-3); exit }' app/package.json)
#
# # Prepare filenames
# if [[ $TARGET_NET = "mainnet" ]]; then
# FILENAME_DEB="concordium-desktop-wallet-${VERSION}.deb"
# FILENAME_RPM="concordium-desktop-wallet-${VERSION}.rpm"
# FILENAME_APPIMAGE="concordium-desktop-wallet-${VERSION}.AppImage"
# else
# FILENAME_DEB="concordium-desktop-wallet-${TARGET_NET}-${VERSION}.deb"
# FILENAME_RPM="concordium-desktop-wallet-${TARGET_NET}-${VERSION}.rpm"
# FILENAME_APPIMAGE="concordium-desktop-wallet-${TARGET_NET}-${VERSION}.AppImage"
# fi
#
# FILENAME_LATEST_LINUX="latest-linux.yml"
#
# OUT_FILENAME_DEB="${VERSION}/${TARGET_NET}/${FILENAME_DEB}"
# OUT_FILENAME_RPM="${VERSION}/${TARGET_NET}/${FILENAME_RPM}"
# OUT_FILENAME_APPIMAGE="${VERSION}/${TARGET_NET}/${FILENAME_APPIMAGE}"
# OUT_LATEST_LINUX="${VERSION}/${TARGET_NET}/latest-linux.yml"
#
# # Push to s3
# echo ${FILENAME_DEB}
# echo ${FILENAME_RPM}
# echo ${FILENAME_APPIMAGE}
# echo ${FILENAME_LATEST_LINUX}
# aws s3 cp "release/${FILENAME_DEB}" "${{env.S3_BUCKET}}/${OUT_FILENAME_DEB}" --grants read=uri=http://acs.amazonaws.com/groups/global/AllUsers
# aws s3 cp "release/${FILENAME_RPM}" "${{env.S3_BUCKET}}/${OUT_FILENAME_RPM}" --grants read=uri=http://acs.amazonaws.com/groups/global/AllUsers
# aws s3 cp "release/${FILENAME_APPIMAGE}" "${{env.S3_BUCKET}}/${OUT_FILENAME_APPIMAGE}" --grants read=uri=http://acs.amazonaws.com/groups/global/AllUsers
# aws s3 cp "release/${FILENAME_LATEST_LINUX}" "${{env.S3_BUCKET}}/${OUT_LATEST_LINUX}" --grants read=uri=http://acs.amazonaws.com/groups/global/AllUsers
release-desktop-wallet-windows:
runs-on: windows-latest
environment: release
needs: login-aws
steps:
- name: aws creds
uses: aws-actions/configure-aws-credentials@v4
id: creds
with:
aws-region: "eu-west-1"
role-to-assume: ${{ env.AWS_ROLE_TO_ASSUME }}
role-session-name: ReleaseDesktopWalletSession
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: recursive
ref: v1..7.4
- name: install dependencies
uses: jetli/[email protected]
with:
version: 'v0.9.1'
- name: install node
uses: actions/setup-node@v4
with:
node-version: 14.16.0
- name: setup
shell: bash
run: |
# Extract version number
VERSION=$(awk '/"version":/ { print substr($2, 2, length($2)-3); exit }' app/package.json)
if [[ $TARGET_NET = "mainnet" ]]; then
FILENAME_EXE="concordium-desktop-wallet-${VERSION}.exe"
else
FILENAME_EXE="concordium-desktop-wallet-${TARGET_NET}-${VERSION}.exe"
fi
OUT_FILENAME_EXE="${VERSION}/${TARGET_NET}/${FILENAME_EXE}/test"
check_uniqueness() {
# Fail if file already exists
totalFoundObjects=$(aws s3 ls "${{env.S3_BUCKET}}/$1" --summarize | grep "Total Objects: " | sed 's/[^0-9]*//g')
if [ "$totalFoundObjects" -ne "0" ]; then
echo "${{env.S3_BUCKET}}/$1 already exists"
false
fi
}
OUT_FILENAME_LATEST_WINDOWS="${VERSION}/${TARGET_NET}/latest.yml"
#check_uniqueness "${OUT_FILENAME_EXE}"
#check_uniqueness "${OUT_FILENAME_LATEST_WINDOWS}"
# Print system info
node --version
npm --version
yarn --version
python --version
rustup show
wasm-pack --version
# Install dependencies
yarn
# Build
yarn package-win-no-sign