Skip to content

Commit

Permalink
feat: final review and test
Browse files Browse the repository at this point in the history
  • Loading branch information
pedrorezende committed Jan 14, 2025
1 parent e246060 commit a1ce91a
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 33 deletions.
13 changes: 8 additions & 5 deletions .github/actions/build-extension/action.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
name: build-extension
description: Build the browser extension and upload to Github release
on:
workflow_call:
inputs:
Expand All @@ -11,25 +12,27 @@ on:

runs:
using: composite
shell: bash
env:
GH_TOKEN: ${{ github.token }}
steps:
- name: Install Dependencies
uses: ./.github/actions/prepare-build

- name: Build WASM dependencies
working-directory: ./apps/extension
run: yarn wasm:build
shell: bash

- name: Build ${{ inputs.browser }} extension
working-directory: ./apps/extension
env:
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
3 changes: 2 additions & 1 deletion .github/actions/prepare-build/action.yml
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -13,3 +13,4 @@ runs:

- name: Install protoc
run: sudo apt-get install -y protobuf-compiler
shell: bash
10 changes: 8 additions & 2 deletions .github/actions/release-project/action.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
name: release-project
description: Upload the project artifact to the GitHub release
on:
workflow_call:
inputs:
Expand All @@ -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
42 changes: 17 additions & 25 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -28,64 +27,58 @@ 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:
needs: [release-please]
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
Expand All @@ -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
Expand Down

0 comments on commit a1ce91a

Please sign in to comment.