Test check version #135
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: "mainnet" | |
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: Check version | |
run: | | |
# Extract version number | |
VERSION=$(awk '/"version":/ { print substr($2, 2, length($2)-3); exit }' app/package.json) | |
TAG_VERSION=${{ github.ref_name }} | |
if [ $VERSION -ne $TAG_VERSION ]; then | |
echo "Tag version is not correct. Tag version: $TAG_VERSION version from package.json: $VERSION" | |
EC=0 | |
exit 1 | |
fi | |
echo "VERSION=$VERSION" >> $GITHUB_ENV | |
- 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:${{ env.VERSION }}-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 AWS CLI | |
run: apt install awscli -y | |
- 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: check if executable exist | |
run: | | |
set +e | |
TARGET_NET=${{env.TARGET_NET}} | |
# Prepare filenames | |
if [ $TARGET_NET = "mainnet" ]; then | |
FILENAME_DEB="concordium-desktop-wallet-${{ env.VERSION }}.deb" | |
FILENAME_RPM="concordium-desktop-wallet-${{ env.VERSION }}.rpm" | |
FILENAME_APPIMAGE="concordium-desktop-wallet-${{ env.VERSION }}.AppImage" | |
FILENAME="concordium-desktop-wallet-${{ env.VERSION }}" | |
else | |
FILENAME_DEB="concordium-desktop-wallet-${TARGET_NET}-${{ env.VERSION }}.deb" | |
FILENAME_RPM="concordium-desktop-wallet-${TARGET_NET}-${{ env.VERSION }}.rpm" | |
FILENAME_APPIMAGE="concordium-desktop-wallet-${TARGET_NET}-${{ env.VERSION }}.AppImage" | |
FILENAME="concordium-desktop-wallet-${TARGET_NET}-${{ env.VERSION }}" | |
fi | |
FILENAME_LATEST_LINUX="latest-linux.yml" | |
OUT_FILENAME_DEB="${{ env.VERSION }}/${TARGET_NET}/${FILENAME_DEB}" | |
OUT_FILENAME_RPM="${{ env.VERSION }}/${TARGET_NET}/${FILENAME_RPM}" | |
OUT_FILENAME_APPIMAGE="${{ env.VERSION }}/${TARGET_NET}/${FILENAME_APPIMAGE}" | |
OUT_FILENAME="${{ env.VERSION }}/${TARGET_NET}/${FILENAME}" | |
OUT_LATEST_LINUX="${{ env.VERSION }}/${TARGET_NET}/latest-linux.yml" | |
aws s3 ls ${{env.S3_BUCKET}}/${OUT_FILENAME}.deb | |
EC=$? | |
if [ EC -eq 0 ]; then | |
echo ".deb file already exist" | |
elif [ EC -ne 1 ]; then | |
echo "Error: $EC" | |
fi | |
echo "EXIT_CODE=$EC" >> $GITHUB_ENV | |
echo "OUT_FILENAME=$OUT_FILENAME" >> $GITHUB_ENV | |
echo "FILENAME=$FILENAME" >> $GITHUB_ENV | |
echo "OUT_YML_FILENAME=$OUT_LATEST_LINUX" >> $GITHUB_ENV | |
- name: Install dependencies and build | |
if: ${{ env.EXIT_CODE == 1 }} | |
run: | | |
rustup default stable | |
node --version | |
npm --version | |
yarn --version | |
python --version | |
rustup show | |
wasm-pack --version | |
yarn | |
yarn package | |
- name: publish | |
if: ${{ env.EXIT_CODE == 1 }} | |
run: | | |
set +e | |
# Push to s3 | |
aws s3 cp "release/${{ env.FILENAME }}.deb" "${{env.S3_BUCKET}}/test/${{ env.OUT_FILENAME }}.deb" --grants read=uri=http://acs.amazonaws.com/groups/global/AllUsers | |
aws s3 cp "release/${{ env.FILENAME }}.rpm" "${{env.S3_BUCKET}}/test/${{ env.OUT_FILENAME }}.rpm" --grants read=uri=http://acs.amazonaws.com/groups/global/AllUsers | |
aws s3 cp "release/${{ env.FILENAME }}.AppImage" "${{env.S3_BUCKET}}/test/${{ env.OUT_FILENAME }}.rpm" --grants read=uri=http://acs.amazonaws.com/groups/global/AllUsers | |
aws s3 cp "release/latest-linux.yml" "${{env.S3_BUCKET}}/test/${{ env.OUT_YML_FILENAME }}" --grants read=uri=http://acs.amazonaws.com/groups/global/AllUsers | |
#using windows-2019 to be able to use visual studio 2019, newer versions do not support older versions of node | |
release-desktop-wallet-windows: | |
runs-on: windows-2019 | |
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: ${{ github.ref_name }} | |
- 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: Check if file exists | |
shell: bash | |
run: | | |
set +e | |
TARGET_NET=${{env.TARGET_NET}} | |
if [ $TARGET_NET = "mainnet" ]; then | |
FILENAME_EXE="concordium-desktop-wallet-${{ env.VERSION }}.exe" | |
else | |
FILENAME_EXE="concordium-desktop-wallet-${TARGET_NET}-${{ env.VERSION }}.exe" | |
fi | |
OUT_YML="${{ env.VERSION }}/${TARGET_NET}/latest.yml" | |
OUT_FILENAME_EXE="${{ env.VERSION }}/${TARGET_NET}/${FILENAME_EXE}" | |
aws s3 ls ${{ env.S3_BUCKET }}/$OUT_FILENAME_EXE | |
EC=$? | |
echo $EC | |
if [ $EC -eq 0 ]; then | |
echo "$OUT_OBJECT already exist" | |
elif [ $EC -ne 1 ]; then | |
echo "Error: $EC" | |
fi | |
echo "OUT_EXE=$OUT_FILENAME_EXE" >> $GITHUB_ENV | |
echo "FILENAME_EXE=$FILENAME_EXE" >> $GITHUB_ENV | |
echo "OUT_YML=$OUT_YML" >> $GITHUB_ENV | |
echo "EXIT_CODE=$EC" >> $GITHUB_ENV | |
- name: Build and push desktop wallet | |
if: ${{ env.EXIT_CODE == 1 }} | |
shell: bash | |
run: | | |
TARGET_NET=${{env.TARGET_NET}} | |
# Print system info | |
node --version | |
npm --version | |
yarn --version | |
python --version | |
rustup show | |
wasm-pack --version | |
# Install dependencies | |
yarn --network-timeout 1000000 | |
# Build | |
yarn package-win-no-sign | |
ls release | |
# Push | |
aws s3 cp "release/latest.yml" ${{ env.S3_BUCKET }}/test/${{ env.OUT_YML }} --grants read=uri=http://acs.amazonaws.com/groups/global/AllUsers | |
aws s3 cp "release/${{ env.FILENAME_EXE}}" ${{ env.S3_BUCKET }}/test/${{ env.OUT_EXE }} --grants read=uri=http://acs.amazonaws.com/groups/global/AllUsers | |