|
| 1 | +name: Publish |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - alpha |
| 7 | + - main |
| 8 | + - release |
| 9 | + workflow_dispatch: |
| 10 | + |
| 11 | +concurrency: release |
| 12 | + |
| 13 | +permissions: |
| 14 | + contents: write |
| 15 | + issues: write |
| 16 | + pull-requests: write |
| 17 | + |
| 18 | +jobs: |
| 19 | + build: |
| 20 | + name: 'Build @algorandfoundation/algorand-typescript-testing' |
| 21 | + uses: ./.github/workflows/node-ci.yml |
| 22 | + with: |
| 23 | + pre-test-script: | |
| 24 | + pipx install algokit |
| 25 | + algokit localnet reset --update |
| 26 | + pipx install puyapy |
| 27 | + node-version: 22.x |
| 28 | + run-build: true |
| 29 | + run-commit-lint: true |
| 30 | + audit-script: npm run audit |
| 31 | + upload-artifact-name: algo-ts-testing |
| 32 | + upload-artifact-path: ./dist |
| 33 | + |
| 34 | + release: |
| 35 | + name: Release |
| 36 | + needs: build |
| 37 | + runs-on: ubuntu-latest |
| 38 | + steps: |
| 39 | + - name: Generate bot token |
| 40 | + uses: actions/create-github-app-token@v1 |
| 41 | + id: app_token |
| 42 | + with: |
| 43 | + app-id: ${{ secrets.BOT_ID }} |
| 44 | + private-key: ${{ secrets.BOT_SK }} |
| 45 | + |
| 46 | + - name: Clone repository |
| 47 | + uses: actions/checkout@v4 |
| 48 | + with: |
| 49 | + fetch-depth: 0 |
| 50 | + token: ${{ steps.app_token.outputs.token }} |
| 51 | + |
| 52 | + - name: Use Node.js 22.x |
| 53 | + uses: actions/setup-node@v4 |
| 54 | + with: |
| 55 | + node-version: 22.x |
| 56 | + |
| 57 | + - run: npm ci --ignore-scripts |
| 58 | + |
| 59 | + - name: Download package artifacts |
| 60 | + uses: actions/download-artifact@v4 |
| 61 | + with: |
| 62 | + path: artifacts |
| 63 | + |
| 64 | + - name: Generate semantic version for @algorandfoundation/algorand-typescript-testing |
| 65 | + if: github.ref_name != 'main' |
| 66 | + run: npx semantic-release |
| 67 | + env: |
| 68 | + GITHUB_TOKEN: ${{ steps.app_token.outputs.token }} |
| 69 | + |
| 70 | +<<<<<<< HEAD |
| 71 | + # - name: Publish @algorandfoundation/algorand-typescript-testing |
| 72 | + # if: github.ref_name != 'main' |
| 73 | + # uses: JS-DevTools/npm-publish@v3 |
| 74 | + # with: |
| 75 | + # token: ${{ secrets.NPM_TOKEN }} |
| 76 | + # package: artifacts/algo-ts-testing/package.json |
| 77 | + # access: 'public' |
| 78 | + # tag: ${{ github.ref_name == 'alpha' && 'alpha' || github.ref_name == 'main' && 'beta' || github.ref_name == 'release' && 'latest' || 'pre-release' }} |
| 79 | +======= |
| 80 | + - name: Publish @algorandfoundation/algorand-typescript-testing |
| 81 | + uses: JS-DevTools/npm-publish@v3 |
| 82 | + with: |
| 83 | + token: ${{ secrets.NPM_TOKEN }} |
| 84 | + package: artifacts/algo-ts-testing/package.json |
| 85 | + access: 'public' |
| 86 | + tag: ${{ github.ref_name == 'alpha' && 'alpha' || github.ref_name == 'main' && 'beta' || github.ref_name == 'release' && 'latest' || 'pre-release' }} |
| 87 | +>>>>>>> 98ff4b5 (build: uncomment release steps to publish production version) |
| 88 | + |
| 89 | + publish-docs: |
| 90 | + name: Publish docs |
| 91 | + needs: release |
| 92 | + if: github.ref_name == 'release' |
| 93 | + uses: ./.github/workflows/gh-pages.yml |
| 94 | + permissions: |
| 95 | + contents: read |
| 96 | + pages: write |
| 97 | + id-token: write |
0 commit comments