diff --git a/.github/actions/build-extension/action.yml b/.github/actions/build-extension/action.yml index 23e4011ca..b3259bbdc 100644 --- a/.github/actions/build-extension/action.yml +++ b/.github/actions/build-extension/action.yml @@ -1,4 +1,5 @@ name: build-extension +description: Build the browser extension and upload to Github release on: workflow_call: inputs: @@ -11,9 +12,6 @@ on: runs: using: composite - shell: bash - env: - GH_TOKEN: ${{ github.token }} steps: - name: Install Dependencies uses: ./.github/actions/prepare-build @@ -21,6 +19,7 @@ runs: - name: Build WASM dependencies working-directory: ./apps/extension run: yarn wasm:build + shell: bash - name: Build ${{ inputs.browser }} extension working-directory: ./apps/extension @@ -28,8 +27,12 @@ runs: SHA: ${{ github.sha }} run: | NAMADA_INTERFACE_REVISION=$SHA yarn build:${{ inputs.browser }} + shell: bash - name: Upload ${{ inputs.browser }} Artifact run: | - gh release upload ${{ inputs.tag }} \ - ./apps/extension/build/${{ inputs.browser }}/namada_keychain-*.zip#$namada_keychain_${{ inputs.browser }}.zip + BASE_VERSION=$(node -e 'console.log(require("./apps/extension/package.json").version)') + FILENAME=namada-keychain-${{ inputs.browser }}-${BASE_VERSION}.zip + mv ./apps/extension/build/${{ inputs.browser }}/namada_keychain-${BASE_VERSION}.zip ${FILENAME} + gh release upload ${{ inputs.tag }} ${FILENAME} + shell: bash diff --git a/.github/actions/prepare-build/action.yml b/.github/actions/prepare-build/action.yml index cb7779c83..b99276d13 100644 --- a/.github/actions/prepare-build/action.yml +++ b/.github/actions/prepare-build/action.yml @@ -1,7 +1,7 @@ name: prepare-build +description: Prepare the build environment runs: using: composite - shell: bash steps: - name: Install yarn dependencies uses: ./.github/actions/yarn-cache @@ -13,3 +13,4 @@ runs: - name: Install protoc run: sudo apt-get install -y protobuf-compiler + shell: bash diff --git a/.github/actions/release-project/action.yml b/.github/actions/release-project/action.yml index 5b8ed8322..83f0692da 100644 --- a/.github/actions/release-project/action.yml +++ b/.github/actions/release-project/action.yml @@ -1,4 +1,5 @@ name: release-project +description: Upload the project artifact to the GitHub release on: workflow_call: inputs: @@ -8,19 +9,24 @@ on: bundle_filename: required: true type: string + working_dir: + required: true + type: string runs: using: composite - shell: bash steps: - name: Install Dependencies uses: ./.github/actions/prepare-build - name: Build Artifact + working-directory: ${{ inputs.working_dir }} run: yarn build + shell: bash - name: Upload artifact + working-directory: ${{ inputs.working_dir }}/dist run: | - cd dist zip -r ${{ inputs.bundle_filename }} . gh release upload ${{ inputs.tag }} ${{ inputs.bundle_filename }} + shell: bash diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d1db0d246..5415d8e5f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -14,11 +14,10 @@ jobs: env: GITHUB_TOKEN: ${{ github.token }} outputs: - namadillo_tag: ${{ steps.release.outputs["apps/namadillo--tag_name"] }} - extension_tag: ${{ steps.release.outputs["apps/extension--tag_name"] }} - types_tag: ${{ steps.release.outputs["packages/types--tag_name"] }} - sdk_tag: ${{ steps.release.outputs["packages/sdk--tag_name"] }} - + namadillo_tag: ${{ steps.release.outputs['apps/namadillo--tag_name'] }} + extension_tag: ${{ steps.release.outputs['apps/extension--tag_name'] }} + types_tag: ${{ steps.release.outputs['packages/types--tag_name'] }} + sdk_tag: ${{ steps.release.outputs['packages/sdk--tag_name'] }} steps: - uses: googleapis/release-please-action@v4 id: release @@ -28,36 +27,33 @@ jobs: if: ${{ needs.release-please.outputs.namadillo_tag }} name: Release Namadillo runs-on: ubuntu-latest - defaults: - run: - working-directory: ./apps/namadillo env: GH_TOKEN: ${{ github.token }} steps: - name: Checkout repository uses: actions/checkout@v4 - - uses: ./.github/actions/release-project + - name: Build and Release Namadillo + uses: ./.github/actions/release-project with: tag: ${{ needs.release-please.outputs.namadillo_tag }} bundle_filename: ${{ needs.release-please.outputs.namadillo_tag }}.zip + working_dir: ./apps/namadillo build-sdk: needs: [release-please] if: ${{ needs.release-please.outputs.sdk_tag }} name: Release SDK runs-on: ubuntu-latest - defaults: - run: - working-directory: ./packages/sdk env: GH_TOKEN: ${{ github.token }} steps: - name: Checkout repository uses: actions/checkout@v4 - - uses: ./.github/actions/release-project + - name: Build and Release SDK + uses: ./.github/actions/release-project with: tag: ${{ needs.release-please.outputs.sdk_tag }} - bundle_filename: ${{ needs.release-please.outputs.sdk_tag }}.zip + bundle_filename: namada-${{ needs.release-please.outputs.sdk_tag }}.zip working_dir: ./packages/sdk build-types: @@ -65,27 +61,24 @@ jobs: if: ${{ needs.release-please.outputs.types_tag }} name: Release Types runs-on: ubuntu-latest - defaults: - run: - working-directory: ./packages/types env: GH_TOKEN: ${{ github.token }} steps: - name: Checkout repository uses: actions/checkout@v4 - - uses: ./.github/actions/release-project + - name: Build and Release Types + uses: ./.github/actions/release-project with: tag: ${{ needs.release-please.outputs.types_tag }} - bundle_filename: ${{ needs.release-please.outputs.types_tag }}.zip + bundle_filename: namada-${{ needs.release-please.outputs.types_tag }}.zip working_dir: ./packages/types build-keychain-chrome: needs: release-please if: ${{ needs.release-please.outputs.extension_tag }} runs-on: ubuntu-24.04 - defaults: - run: - working-directory: ./apps/extension + env: + GH_TOKEN: ${{ github.token }} steps: - name: Checkout repository uses: actions/checkout@v4 @@ -99,9 +92,8 @@ jobs: needs: release-please if: ${{ needs.release-please.outputs.extension_tag }} runs-on: ubuntu-24.04 - defaults: - run: - working-directory: ./apps/extension + env: + GH_TOKEN: ${{ github.token }} steps: - name: Checkout repository uses: actions/checkout@v4