|
| 1 | +name: Release Upgradeable |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_dispatch: {} |
| 5 | + |
| 6 | +jobs: |
| 7 | + state: |
| 8 | + name: Check state |
| 9 | + permissions: |
| 10 | + pull-requests: read |
| 11 | + if: ${{ !endsWith(github.repository, '-upgradeable') }} |
| 12 | + runs-on: ubuntu-latest |
| 13 | + steps: |
| 14 | + - uses: actions/checkout@v6 |
| 15 | + with: |
| 16 | + repository: ${{ github.repository }}-upgradeable |
| 17 | + ref: ${{ github.ref }} |
| 18 | + - uses: actions/checkout@v6 |
| 19 | + with: |
| 20 | + ref: ${{ github.ref }} |
| 21 | + path: lib/openzeppelin-contracts |
| 22 | + - name: Set up environment |
| 23 | + uses: ./.github/actions/setup |
| 24 | + - name: Check upgradeable |
| 25 | + id: check-upgradeable |
| 26 | + run: bash scripts/release/workflow/check-upgradeable.sh |
| 27 | + outputs: |
| 28 | + publish: ${{ steps.check-upgradeable.outcome }} |
| 29 | + is_prerelease: ${{ steps.check-upgradeable.outputs.is_prerelease }} |
| 30 | + |
| 31 | + # copied from release-cycle.yml |
| 32 | + publish: |
| 33 | + needs: state |
| 34 | + name: Publish to npm |
| 35 | + environment: push-upgradeable |
| 36 | + permissions: |
| 37 | + id-token: write |
| 38 | + if: needs.state.outputs.publish == 'success' # Note: changed from 'true' to 'success' to support the way publish is computed |
| 39 | + runs-on: ubuntu-latest |
| 40 | + steps: |
| 41 | + - uses: actions/checkout@v6 |
| 42 | + with: |
| 43 | + repository: ${{ github.repository }}-upgradeable |
| 44 | + ref: ${{ github.ref }} |
| 45 | + - uses: actions/checkout@v6 |
| 46 | + with: |
| 47 | + ref: ${{ github.ref }} |
| 48 | + path: lib/openzeppelin-contracts |
| 49 | + - name: Set up environment |
| 50 | + uses: ./.github/actions/setup |
| 51 | + - id: pack |
| 52 | + name: Pack |
| 53 | + run: bash scripts/release/workflow/pack.sh |
| 54 | + env: |
| 55 | + PRERELEASE: ${{ needs.state.outputs.is_prerelease }} |
| 56 | + - name: Upload tarball artifact |
| 57 | + uses: actions/upload-artifact@v5 |
| 58 | + with: |
| 59 | + name: ${{ github.ref_name }}-upgradeable |
| 60 | + path: ${{ steps.pack.outputs.tarball }} |
| 61 | + - name: Publish |
| 62 | + run: bash scripts/release/workflow/publish.sh |
| 63 | + env: |
| 64 | + TARBALL: ${{ steps.pack.outputs.tarball }} |
| 65 | + TAG: ${{ steps.pack.outputs.tag }} |
| 66 | + - name: Create Github Release |
| 67 | + uses: actions/github-script@v8 |
| 68 | + env: |
| 69 | + PRERELEASE: ${{ needs.state.outputs.is_prerelease }} |
| 70 | + TARGET_COMMIT: ${{ github.ref }} |
| 71 | + REPO_SUFFIX: -upgradeable |
| 72 | + with: |
| 73 | + github-token: ${{ secrets.GH_TOKEN_UPGRADEABLE }} |
| 74 | + script: await require('./scripts/release/workflow/github-release.js')({ github, context }) |
| 75 | + outputs: |
| 76 | + tarball_name: ${{ steps.pack.outputs.tarball_name }} |
| 77 | + |
| 78 | + integrity_check: |
| 79 | + needs: publish |
| 80 | + name: Tarball Integrity Check |
| 81 | + runs-on: ubuntu-latest |
| 82 | + steps: |
| 83 | + - uses: actions/checkout@v6 |
| 84 | + with: |
| 85 | + repository: ${{ github.repository }}-upgradeable |
| 86 | + ref: ${{ github.ref }} |
| 87 | + - name: Download tarball artifact |
| 88 | + id: artifact |
| 89 | + uses: actions/download-artifact@v6 |
| 90 | + with: |
| 91 | + name: ${{ github.ref_name }}-upgradeable |
| 92 | + - name: Check integrity |
| 93 | + run: bash scripts/release/workflow/integrity-check.sh |
| 94 | + env: |
| 95 | + TARBALL: ${{ steps.artifact.outputs.download-path }}/${{ needs.publish.outputs.tarball_name }} |
0 commit comments