|
| 1 | +name: Release |
| 2 | +on: |
| 3 | + schedule: |
| 4 | + - cron: '0 10 * * 1-4' # run 12:00 UTC+2 Monday-Thursday |
| 5 | + workflow_dispatch: |
| 6 | + inputs: |
| 7 | + debug_enabled: |
| 8 | + type: boolean |
| 9 | + description: 'Run the build with tmate debugging enabled (https://github.com/marketplace/actions/debugging-with-tmate)' |
| 10 | + required: false |
| 11 | + default: false |
| 12 | + |
| 13 | +jobs: |
| 14 | + tag: |
| 15 | + runs-on: ubuntu-latest |
| 16 | + outputs: |
| 17 | + new_tag: ${{ steps.github-tag-action.outputs.new_tag }} |
| 18 | + changelog: ${{ steps.github-tag-action.outputs.changelog }} |
| 19 | + steps: |
| 20 | + - uses: actions/checkout@v3 |
| 21 | + - name: Bump and tag |
| 22 | + id: github-tag-action |
| 23 | + uses: mathieudutour/[email protected] |
| 24 | + with: |
| 25 | + github_token: ${{ secrets.GITHUB_TOKEN }} |
| 26 | + # new_tag is only set when there are new semver commits |
| 27 | + # on the release branch |
| 28 | + release_branches: release |
| 29 | + default_bump: patch |
| 30 | + |
| 31 | + release: |
| 32 | + needs: tag |
| 33 | + # only release when there is a new tag |
| 34 | + if: ${{ needs.tag.outputs.new_tag != null }} |
| 35 | + runs-on: ubuntu-latest |
| 36 | + steps: |
| 37 | + - uses: actions/checkout@v3 |
| 38 | + - uses: ./.github/actions/setup |
| 39 | + - name: Add .env files |
| 40 | + run: echo ${{secrets.ENV_WEBSITE_BASE64}} | base64 -d > ./packages/website/.env |
| 41 | + |
| 42 | + - name: Setup tmate session |
| 43 | + uses: mxschmitt/action-tmate@v3 |
| 44 | + if: ${{ github.event_name == 'workflow_dispatch' && inputs.debug_enabled }} |
| 45 | + timeout-minutes: 15 |
| 46 | + with: |
| 47 | + limit-access-to-actor: true |
| 48 | + |
| 49 | + - name: Build |
| 50 | + env: |
| 51 | + CI: true |
| 52 | + run: | |
| 53 | + yarn |
| 54 | + yarn workspace @package/dump-pow-contracts compile |
| 55 | + yarn workspace @package/dump-pow-website run build |
| 56 | + yarn workspace @package/dump-pow-website run export |
| 57 | +
|
| 58 | + - uses: aquiladev/[email protected] |
| 59 | + id: upload |
| 60 | + with: |
| 61 | + service: pinata |
| 62 | + pinataKey: ${{ secrets.PINATA_KEY }} |
| 63 | + pinataSecret: ${{ secrets.PINATA_SECRET }} |
| 64 | + |
| 65 | + - name: Release |
| 66 | + |
| 67 | + env: |
| 68 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 69 | + with: |
| 70 | + tag_name: ${{ needs.tag.outputs.new_tag }} |
| 71 | + release_name: Release ${{ needs.tag.outputs.new_tag }} |
| 72 | + body: | |
| 73 | +
|
| 74 | + ${{ needs.tag.outputs.changelog }} |
0 commit comments