diff --git a/.github/workflows/submitBeta.yml b/.github/workflows/submitBeta.yml index 9143c0c1c4..cfeb7f884d 100644 --- a/.github/workflows/submitBeta.yml +++ b/.github/workflows/submitBeta.yml @@ -13,6 +13,11 @@ on: description: Beta version default: "0" required: true + ref_name: + description: + A git ref to checkout (branch/tag/sha). Defaults to release/ + type: string + default: "" jobs: bump-version: name: Bump Package Version and Submit Extension @@ -31,7 +36,10 @@ jobs: - name: Checkout code uses: actions/checkout@v6 with: - ref: release/${{ github.event.inputs.release }} + ref: ${{ github.event.inputs.ref_name != '' && github.event.inputs.ref_name || format('release/{0}', github.event.inputs.release) }} + - name: Get checkout SHA + id: checkout_sha + run: echo "sha=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT - name: Update manifest-v2.json name uses: jossef/action-set-json-field@2a0f7d953b580b828717daf4de7fafc7e4135e97 #v2 with: @@ -118,6 +126,7 @@ jobs: github.event.inputs.version }} draft: false prerelease: true + target_commitish: ${{ steps.checkout_sha.outputs.sha }} - name: Upload Release Asset id: upload-release-asset uses: actions/upload-release-asset@v1 diff --git a/.github/workflows/submitProduction.yml b/.github/workflows/submitProduction.yml index 209cf22d95..b5cdfd9b20 100644 --- a/.github/workflows/submitProduction.yml +++ b/.github/workflows/submitProduction.yml @@ -5,6 +5,11 @@ env: HUSKY: 0 on: workflow_dispatch: + inputs: + ref_name: + description: A git commit/hash/tag (optional, defaults to the selected branch or tag) + type: string + default: "" jobs: bump-version: name: Bump Package Version and Submit Extension @@ -22,6 +27,11 @@ jobs: gh run watch ${{ github.run_id }} - name: Checkout code uses: actions/checkout@v6 + with: + ref: ${{ github.event.inputs.ref_name != '' && github.event.inputs.ref_name || github.ref_name }} + - name: Get checkout SHA + id: checkout_sha + run: echo "sha=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT - name: Get version from package.json id: package_version run: | @@ -36,9 +46,8 @@ jobs: node-version: 22 - run: > yarn && yarn build:freighter-api && yarn build:extension:production - --env AMPLITUDE_KEY="${{ secrets.AMPLITUDE_KEY }}" - SENTRY_KEY="${{ secrets.SENTRY_KEY }}" - BUILD_TYPE="production" + --env AMPLITUDE_KEY="${{ secrets.AMPLITUDE_KEY }}" SENTRY_KEY="${{ + secrets.SENTRY_KEY }}" BUILD_TYPE="production" - name: Install zip uses: montudor/action-zip@0852c26906e00f8a315c704958823928d8018b28 #v1.0.0 - name: Create git tag @@ -54,6 +63,7 @@ jobs: body: ${{ steps.package_version.outputs.version }} draft: false prerelease: false + target_commitish: ${{ steps.checkout_sha.outputs.sha }} - name: Build for Firefox id: web-ext-build uses: kewisch/action-web-ext@fe10addf5d5e5ba6b78ffde720dd488a27d10e8c #v1