chore: Version bump for next release #220
Workflow file for this run
This file contains hidden or 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: X1 Wallet Firmware | ||
| on: | ||
| push: | ||
| tags: | ||
| - v* | ||
| branches: | ||
| - release** | ||
| paths: | ||
| - "version.txt" | ||
| jobs: | ||
| build-firmwares: | ||
| strategy: | ||
| matrix: | ||
| firmware: [Main] | ||
| target: [Release] | ||
| vendor: [Cypherock, Odix] | ||
| coin_support: ["BTC_ONLY", "MULTI_COIN"] | ||
| exclude: | ||
| - vendor: Odix | ||
| coin_support: BTC_ONLY | ||
| uses: ./.github/workflows/containerized-build.yml | ||
| with: | ||
| firmware: ${{ matrix.firmware }} | ||
| target: ${{ matrix.target }} | ||
| vendor: ${{ matrix.vendor }} | ||
| coin_support_variant: ${{ matrix.coin_support }} | ||
| secrets: inherit | ||
| create-release: | ||
| needs: build-firmwares | ||
| runs-on: ubuntu-latest | ||
| if: ${{ github.ref_type }} == 'tag' | ||
|
Check warning on line 34 in .github/workflows/build.yml
|
||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v3 | ||
| - name: Download artifacts | ||
| uses: actions/download-artifact@v4 | ||
| with: | ||
| path: ./ | ||
| - name: Publish a release | ||
| env: | ||
| TAG_NAME: ${{ github.ref_name }} | ||
| auth_token: ${{ secrets.GITHUB_TOKEN }} | ||
| REPOSITORY: ${{ github.repository }} | ||
| run: | | ||
| # Calculate SHA256 hash for the Cypherock firmware with MULTI_COIN support | ||
| chkmain_cypherock_multicoin=$(sha256sum Main-Release-Cypherock-MULTI_COIN-outputs/Cypherock-Main.bin | cut -f -1 -d ' ') | ||
| # Calculate SHA256 hash for the Cypherock firmware with BTC_ONLY support | ||
| chkmain_cypherock_btc_only=$(sha256sum Main-Release-Cypherock-BTC_ONLY-outputs/Cypherock-Main-BTC.bin | cut -f -1 -d ' ') | ||
| # Calculate SHA256 hash for the Odix firmware with MULTI_COIN support | ||
| chkmain_odix_multicoin=$(sha256sum Main-Release-Odix-MULTI_COIN-outputs/Odix-Main.bin | cut -f -1 -d ' ') | ||
| APP_VERSION=$(cat version.txt | grep firmware | cut -f 2-2 -d '=' | awk -F ':' '{ print 0+$1 "." 0+$2 "." $3*2**8 + $4 }') | ||
| HW_VERSION=$(cat version.txt | grep hardware | cut -f 2-2 -d '=' | awk -F ':' '{ print 0+$1 "." 0+$2 "." $3*2**8 + $4 }') | ||
| echo "Application version: ${APP_VERSION}" | ||
| echo "Hardware version: ${HW_VERSION}" | ||
| # Create the release with all firmware hashes in the body | ||
| curl -X POST \ | ||
| -H "Accept: application/vnd.github+json" \ | ||
| -H "Authorization: Bearer ${auth_token}" \ | ||
| -H "X-GitHub-Api-Version: 2022-11-28" \ | ||
| https://api.github.com/repos/${REPOSITORY}/releases \ | ||
| -d '{ | ||
| "tag_name":"'${TAG_NAME}'", | ||
| "target_commitish":"main", | ||
| "name":"'${TAG_NAME}'", | ||
| "body":"Application version: '${APP_VERSION}'\r\nHardware version: '${HW_VERSION}'\r\n## SHA256 of binaries:\r\n**Cypherock-Main.bin** : '${chkmain_cypherock_multicoin}' \r\n**Cypherock-Main-BTC.bin** : '${chkmain_cypherock_btc_only}' \r\n**Odix-Main.bin** : '${chkmain_odix_multicoin}'", | ||
| "draft":true, | ||
| "prerelease":false, | ||
| "generate_release_notes":true | ||
| }' > output.txt | ||
| # Extract upload_url for subsequent asset uploads | ||
| echo "upload_url=$(cat output.txt | grep "\"upload_url\":" | cut -f 4-4 -d '"' | cut -f 1-1 -d '{')" >> $GITHUB_ENV | ||
| - name: Upload assets | ||
| env: | ||
| auth_token: ${{ secrets.GITHUB_TOKEN }} | ||
| run: | | ||
| # Upload the Cypherock MULTI_COIN firmware binary | ||
| content_type_cypherock_multicoin=$(file -b --mime-type Main-Release-Cypherock-MULTI_COIN-outputs/Cypherock-Main.bin) | ||
| curl -X POST \ | ||
| -H "Content-Type: ${content_type_cypherock_multicoin}" \ | ||
| -H "Accept: application/vnd.github+json" \ | ||
| -H "Authorization: Bearer ${auth_token}" \ | ||
| -H "X-GitHub-Api-Version: 2022-11-28" \ | ||
| "${upload_url}?name=Cypherock-Main.bin" \ | ||
| --data-binary @Main-Release-Cypherock-MULTI_COIN-outputs/Cypherock-Main.bin | ||
| # Upload the Cypherock BTC_ONLY firmware binary | ||
| content_type_cypherock_btc_only=$(file -b --mime-type Main-Release-Cypherock-BTC_ONLY-outputs/Cypherock-Main-BTC.bin) | ||
| curl -X POST \ | ||
| -H "Content-Type: ${content_type_cypherock_btc_only}" \ | ||
| -H "Accept: application/vnd.github+json" \ | ||
| -H "Authorization: Bearer ${auth_token}" \ | ||
| -H "X-GitHub-Api-Version: 2022-11-28" \ | ||
| "${upload_url}?name=Cypherock-Main-BTC.bin" \ | ||
| --data-binary @Main-Release-Cypherock-BTC_ONLY-outputs/Cypherock-Main-BTC.bin | ||
| # Upload the Odix MULTI_COIN firmware binary | ||
| content_type_odix_multicoin=$(file -b --mime-type Main-Release-Odix-MULTI_COIN-outputs/Odix-Main.bin) | ||
| curl -X POST \ | ||
| -H "Content-Type: ${content_type_odix_multicoin}" \ | ||
| -H "Accept: application/vnd.github+json" \ | ||
| -H "Authorization: Bearer ${auth_token}" \ | ||
| -H "X-GitHub-Api-Version: 2022-11-28" \ | ||
| "${upload_url}?name=Odix-Main.bin" \ | ||
| --data-binary @Main-Release-Odix-MULTI_COIN-outputs/Odix-Main.bin | ||
| # Upload version.txt | ||
| content_type_version=$(file -b --mime-type version.txt) | ||
| curl -X POST \ | ||
| -H "Content-Type: ${content_type_version}" \ | ||
| -H "Accept: application/vnd.github+json" \ | ||
| -H "Authorization: Bearer ${auth_token}" \ | ||
| -H "X-GitHub-Api-Version: 2022-11-28" \ | ||
| "${upload_url}?name=version.txt" \ | ||
| --data-binary @version.txt | ||