release: 368/merge #17
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: on_pr_edit | |
run-name: 'release: ${{ github.ref_name }}' | |
on: | |
workflow_dispatch: | |
pull_request: | |
# TODO I'll probably need permission to publish a new release. | |
permissions: | |
id-token: write | |
contents: read | |
env: | |
DMG_FILENAME: "Wallet Recovery Wizard.dmg" | |
EXE_FILENAME: "Wallet Recovery Wizard.exe" | |
DEB_FILENAME: "Wallet Recovery Wizard.deb" | |
jobs: | |
get-current-version: | |
name: Get the current version | |
runs-on: ubuntu-latest | |
outputs: | |
current_version: ${{ steps.get-current-version.outputs.current_version }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- id: get-current-version | |
run: | | |
latest_tag=$(git describe --abbrev=0 --tags | sed "s/v//g") | |
echo "current_version=$latest_tag" >> "$GITHUB_OUTPUT" | |
# TODO move this to the summary. | |
echo "Latest version is $latest_tag" | |
create-new-release-temp: | |
name: Get the current version | |
runs-on: ubuntu-latest | |
needs: | |
- get-current-version | |
steps: | |
- id: get-current-version | |
run: | | |
curl -L \ | |
-X POST \ | |
-H "Accept: application/vnd.github+json" \ | |
-H "Authorization: Bearer ${{ github.token }}" \ | |
-H "X-GitHub-Api-Version: 2022-11-28" \ | |
https://api.github.com/repos/BitGo/wallet-recovery-wizard/releases \ | |
-d '{"tag_name":"v9.9.9999","target_commitish":"master","name":"v9.9.9999","body":"Description of the release","draft":true,"generate_release_notes":true}' | |
exit 1 | |
mac-build: | |
name: Create Mac release | |
runs-on: macos-latest | |
needs: | |
- get-current-version | |
- create-new-release-temp | |
env: | |
CURRENT_VERSION: "${{ needs.get-current-version.outputs.current_version }}" | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version-file: .nvmrc | |
cache: 'npm' | |
# TODO we should pin that version in the package-lock | |
- run: npm install dmg-license | |
- run: npm run build | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: "Wallet Recovery Wizard.dmg" | |
path: "release/${{ env.CURRENT_VERSION }}/Wallet Recovery Wizard-${{ env.CURRENT_VERSION }}.dmg" | |
if-no-files-found: "error" | |
windows-linux-build: | |
name: Create Windows and Linux release | |
runs-on: ubuntu-latest | |
needs: | |
- get-current-version | |
- create-new-release-temp | |
env: | |
CURRENT_VERSION: "${{ needs.get-current-version.outputs.current_version }}" | |
container: | |
# TODO sha-pin this image | |
image: electronuserland/builder:16-wine | |
steps: | |
- uses: actions/checkout@v4 | |
- run: npm install | |
- run: npm run build -- -wl | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: "Wallet Recovery Wizard.exe" | |
path: "release/${{ env.CURRENT_VERSION }}/Wallet Recovery Wizard-Setup-${{ env.CURRENT_VERSION }}.exe" | |
if-no-files-found: "error" | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: "Wallet Recovery Wizard.deb" | |
path: "release/${{ env.CURRENT_VERSION }}/Wallet Recovery Wizard-Linux-${{ env.CURRENT_VERSION }}.deb" | |
if-no-files-found: "error" | |
create-new-release: | |
name: Create a new GitHub release | |
runs-on: ubuntu-latest | |
needs: | |
- mac-build | |
- windows-linux-build | |
env: | |
CURRENT_VERSION: "${{ needs.get-current-version.outputs.current_version }}" | |
container: | |
# TODO sha-pin this image | |
image: electronuserland/builder:16-wine | |
steps: | |
- uses: actions/download-artifact@v4 | |
with: | |
# We don't want to download the artifacts to separate directories, | |
# we want to download them to the same directory instead. | |
merge-multiple: true | |
- run: | | |
sha256sum "${{ env.DEB_FILENAME }}" > "${{ env.DEB_FILENAME }}.sha256sum" | |
sha256sum "${{ env.EXE_FILENAME }}" > "${{ env.EXE_FILENAME }}.sha256sum" | |
sha256sum "${{ env.DMG_FILENAME }}" > "${{ env.DMG_FILENAME }}.sha256sum" | |