Skip to content

chore(release): 4.15.1 #99

chore(release): 4.15.1

chore(release): 4.15.1 #99

Workflow file for this run

name: Publish version
on:
push:
tags-ignore:
- 'v*dev*'
jobs:
build:
runs-on: ${{ matrix.os }}
env:
STX_NETWORK: ${{ matrix.stx_network }}
strategy:
matrix:
os: [macos-11, ubuntu-20.04, windows-latest]
stx_network: [testnet, mainnet]
include:
- os: macos-11
UPLOAD_ASSETS: release/**/*.dmg
NPM_COMMAND: mac
CSC_LINK_SECRET_NAME: CODE_SIGNING_CERTIFICATE_APPLE
CSC_KEY_PASSWORD_SECRET_NAME: CODE_SIGNING_PASSWORD_APPLE
- os: ubuntu-20.04
NPM_COMMAND: linux
UPLOAD_ASSETS: |
release/**/*.deb
release/**/*.rpm
- os: windows-latest
NPM_COMMAND: win
UPLOAD_ASSETS: release/**/*.exe
steps:
- name: Cancel Previous Runs
uses: styfle/[email protected]
with:
access_token: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/checkout@v2
- uses: actions/cache@v2
with:
path: '**/node_modules'
key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}-${{ hashFiles('**/package.json') }}-${{ secrets.CACHE_BUSTER }}
- uses: actions/setup-python@v5
if: matrix.os == 'macos-11'
with:
python-version: '3.10'
- name: Add required Linux dependencies
uses: ./.github/actions/linux-deps
if: matrix.os == 'ubuntu-20.04'
- name: Variables
id: vars
run: |
echo "::set-output name=branch_name::$(echo ${GITHUB_REF#refs/heads/})"
echo "::set-output name=pull_request_id::$(echo $GITHUB_REF)"
- name: Install code-signing certs - Apple only
uses: apple-actions/import-codesign-certs@v1
if: matrix.os == 'macos-11'
with:
p12-file-base64: ${{ secrets.CODE_SIGNING_CERTIFICATE_APPLE }}
p12-password: ${{ secrets.CODE_SIGNING_PASSWORD_APPLE }}
- uses: actions/setup-node@v3
with:
node-version: 18
#
# Windows build breaks when using the package.json script to install `app/` packages
# using separate run to install those packages separately
- name: Install packages
uses: nick-invision/retry@v2
with:
timeout_seconds: 600
max_attempts: 3
retry_on: error
command: yarn --frozen-lockfile --ignore-scripts
- name: Install `app/` packages
run: cd app && yarn --frozen-lockfile --ignore-scripts
- name: Install `concat-map` - Windows only
run: yarn add concat-map --ignore-scripts --frozen-lockfile
if: matrix.os == 'windows-latest'
- name: Build releases
if: matrix.os == 'macos-11'
run: ./node_modules/.bin/cross-env yarn package-${{ matrix.NPM_COMMAND }}
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NODE_ENV: production
SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
SEGMENT_WRITE_KEY: ${{ secrets.SEGMENT_WRITE_KEY }}
CSC_LINK: ${{ secrets[matrix.CSC_LINK_SECRET_NAME] }}
CSC_KEY_PASSWORD: ${{ secrets[matrix.CSC_KEY_PASSWORD_SECRET_NAME] }}
APPLE_ID: ${{ secrets.APPLE_ID }}
APPLE_ID_PASS: ${{ secrets.APPLE_ID_PASS }}
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
- name: Build releases
if: matrix.os != 'macos-11'
run: ./node_modules/.bin/cross-env yarn package-${{ matrix.NPM_COMMAND }}
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NODE_ENV: production
SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
SEGMENT_WRITE_KEY: ${{ secrets.SEGMENT_WRITE_KEY }}
- uses: actions/upload-artifact@v2
name: ${{ matrix.os }} upload
with:
name: leather-wallet-${{ matrix.stx_network }}-${{ matrix.NPM_COMMAND }}
path: ${{ matrix.UPLOAD_ASSETS }}
create-release:
runs-on: ubuntu-20.04
needs:
- build
outputs:
release_upload_url: ${{ steps.create_release.outputs.upload_url }}
new_version: ${{ steps.extract_version.outputs.version }}
steps:
- uses: actions/checkout@v2
with:
token: ${{ secrets.GH_TOKEN || secrets.GITHUB_TOKEN }}
- name: Extract version
id: extract_version
uses: Saionaro/[email protected]
- name: Download binaries
uses: actions/download-artifact@v2
with:
path: release
- name: Move binaries to root directory
run: mv release/*/leather-wallet* .
- name: Download release-notes.txt from create-version workflow
uses: dawidd6/action-download-artifact@v2
with:
workflow: create-version.yml
name: release-notes
- name: Import GPG key
id: import_gpg_key
uses: crazy-max/ghaction-import-gpg@v5
with:
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.GPG_PASSPHRASE }}
- name: Prepare release notes
run: |
sed -i '1d' release-notes.txt
echo "\`\`\`" >> release-notes.txt
shasum -a 256 leather-wallet* >> shasums.txt
gpg --armor --output shasums.txt.asc --clearsign --digest-algo SHA256 shasums.txt
cat release-notes.txt shasums.txt.asc > release-body.txt
echo "\`\`\`" >> release-body.txt
- run: echo ${{ steps.extract_version.outputs.version }}
- name: Create Release
id: create_release
uses: actions/create-release@v1
# check for case where it hasn't found version number
if: steps.extract_version.outputs.version != ''
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v${{ steps.extract_version.outputs.version }}
release_name: Leather v${{ steps.extract_version.outputs.version }}
draft: false
prerelease: ${{ contains(steps.extract_version.outputs.version, 'dev') }}
body_path: release-body.txt
upload-release-assets:
runs-on: ubuntu-20.04
needs:
- build
- create-release
strategy:
max-parallel: 2
matrix:
stx_network: [testnet, mainnet]
ext: [dmg, exe, deb, rpm]
include:
- ext: dmg
os: mac
- ext: exe
os: win
- ext: rpm
os: linux
- ext: deb
os: linux
steps:
- name: Download binaries
uses: actions/download-artifact@v2
with:
path: release
- run: ls -R release
- name: Upload Release Asset .${{ matrix.ext }}
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create-release.outputs.release_upload_url }}
asset_path: release/leather-wallet-${{ matrix.stx_network }}-${{ matrix.os }}/leather-wallet.${{ matrix.stx_network }}.${{ matrix.ext }}
asset_name: leather-wallet.${{ matrix.stx_network }}.v${{ needs.create-release.outputs.new_version }}.${{ matrix.ext }}
asset_content_type: application/octet-stream