diff --git a/.github/actions/build/app/action.yml b/.github/actions/build/app/action.yml new file mode 100644 index 000000000..ae6bfa425 --- /dev/null +++ b/.github/actions/build/app/action.yml @@ -0,0 +1,65 @@ +name: buildapp +description: Build app + +inputs: + DIR: + description: 'app directory' + required: true + NAME: + description: 'app name' + required: true + LACE_EXTENSION_KEY: + description: 'Public extended manifest key' + required: true + BUILD_DEV_PREVIEW: + description: 'Build developer preview of Lace' + required: false + default: 'false' + POSTHOG_PRODUCTION_TOKEN_MAINNET: + description: 'Post hog production mainnet token' + required: false + default: '' + POSTHOG_PRODUCTION_TOKEN_PREPROD: + description: 'Post hog production preprod token' + required: false + default: '' + POSTHOG_PRODUCTION_TOKEN_PREVIEW: + description: 'Post hog production preview token' + required: false + default: '' + PRODUCTION_MODE_TRACKING: + description: 'Enable analytics tracking in production' + required: false + default: 'false' + BANXA_LACE_URL: + description: 'Banxa`s integration URL' + required: false + default: 'https://lacewallet.banxa-sandbox.com/' + +runs: + using: 'composite' + + steps: + - name: Code check + uses: ./.github/actions/check + with: + DIR: ${{ inputs.DIR }} + + - name: Build ${{ inputs.NAME }} + run: yarn build + shell: bash + working-directory: ${{ inputs.DIR }} + env: + LACE_EXTENSION_KEY: ${{ inputs.LACE_EXTENSION_KEY }} + BUILD_DEV_PREVIEW: ${{ inputs.BUILD_DEV_PREVIEW }} + POSTHOG_PRODUCTION_TOKEN_MAINNET: ${{ inputs.POSTHOG_PRODUCTION_TOKEN_MAINNET }} + POSTHOG_PRODUCTION_TOKEN_PREPROD: ${{ inputs.POSTHOG_PRODUCTION_TOKEN_PREPROD }} + POSTHOG_PRODUCTION_TOKEN_PREVIEW: ${{ inputs.POSTHOG_PRODUCTION_TOKEN_PREVIEW }} + PRODUCTION_MODE_TRACKING: ${{ inputs.PRODUCTION_MODE_TRACKING }} + BANXA_LACE_URL: ${{ inputs.BANXA_LACE_URL }} + + - name: Upload artifact + uses: actions/upload-artifact@v4 + with: + name: ${{ inputs.NAME }} + path: ${{ inputs.DIR }}/dist diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 965dedd4c..6579cc5c2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -124,6 +124,68 @@ jobs: - name: Execute unit tests uses: ./.github/actions/test/unit + release-pkg: + name: Release package + runs-on: ubuntu-20.04 + needs: prepare + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Setup Node.js and install dependencies + uses: ./.github/actions/install + with: + WALLET_PASSWORD: ${{ secrets.WALLET_PASSWORD_TESTNET }} + GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} + + - name: Download packages-common + uses: actions/download-artifact@v4 + with: + name: packages-common + path: packages/common/dist + + - name: Download packages-cardano + uses: actions/download-artifact@v4 + with: + name: packages-cardano + path: packages/cardano/dist + + - name: Download packages-translation + uses: actions/download-artifact@v4 + with: + name: packages-translation + path: packages/translation/dist + + - name: Download packages-core + uses: actions/download-artifact@v4 + with: + name: packages-core + path: packages/core/dist + + - name: Download packages-staking + uses: actions/download-artifact@v4 + with: + name: packages-staking + path: packages/staking/dist + + - name: Collect Workflow Telemetry Smoke Tests + uses: catchpoint/workflow-telemetry-action@v2 + with: + comment_on_pr: false + + - name: Build Lace browser extension + uses: ./.github/actions/build/app + with: + DIR: apps/browser-extension-wallet + NAME: lace-browser-extension + LACE_EXTENSION_KEY: ${{ secrets.MANIFEST_PUBLIC_KEY }} + POSTHOG_PRODUCTION_TOKEN_MAINNET: ${{ startsWith(github.ref, 'refs/heads/release') && secrets.POSTHOG_PRODUCTION_TOKEN_MAINNET || '' }} + POSTHOG_PRODUCTION_TOKEN_PREPROD: ${{ startsWith(github.ref, 'refs/heads/release') && secrets.POSTHOG_PRODUCTION_TOKEN_PREPROD || '' }} + POSTHOG_PRODUCTION_TOKEN_PREVIEW: ${{ startsWith(github.ref, 'refs/heads/release') && secrets.POSTHOG_PRODUCTION_TOKEN_PREVIEW || '' }} + PRODUCTION_MODE_TRACKING: ${{ startsWith(github.ref, 'refs/heads/release') && 'true' || 'false' }} + BANXA_LACE_URL: ${{ startsWith(github.ref, 'refs/heads/release') && 'https://lacewallet.banxa.com/' }} + build: name: Build Lace runs-on: ubuntu-22.04