|
| 1 | +name: 'Release: Manual' |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_dispatch: |
| 5 | + inputs: |
| 6 | + version: |
| 7 | + description: 'The version to release (e.g., v0.1.11). Must be a valid semver string with a "v" prefix.' |
| 8 | + required: true |
| 9 | + type: 'string' |
| 10 | + ref: |
| 11 | + description: 'The branch, tag, or SHA to release from.' |
| 12 | + required: true |
| 13 | + type: 'string' |
| 14 | + npm_channel: |
| 15 | + description: 'The npm channel to publish to.' |
| 16 | + required: true |
| 17 | + type: 'choice' |
| 18 | + options: |
| 19 | + - 'stable' |
| 20 | + - 'preview' |
| 21 | + - 'dev' |
| 22 | + dry_run: |
| 23 | + description: 'Run a dry-run of the release process; no branches, npm packages or GitHub releases will be created.' |
| 24 | + required: true |
| 25 | + type: 'boolean' |
| 26 | + default: true |
| 27 | + force_skip_tests: |
| 28 | + description: 'Select to skip the "Run Tests" step in testing. Prod releases should run tests' |
| 29 | + required: false |
| 30 | + type: 'boolean' |
| 31 | + default: false |
| 32 | + |
| 33 | +jobs: |
| 34 | + release: |
| 35 | + runs-on: 'ubuntu-latest' |
| 36 | + permissions: |
| 37 | + contents: 'write' |
| 38 | + packages: 'write' |
| 39 | + issues: 'write' |
| 40 | + steps: |
| 41 | + - name: 'Checkout' |
| 42 | + uses: 'actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8' |
| 43 | + with: |
| 44 | + ref: '${{ github.event.inputs.ref }}' |
| 45 | + fetch-depth: 0 |
| 46 | + |
| 47 | + - name: 'Setup Node.js' |
| 48 | + uses: 'actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020' |
| 49 | + with: |
| 50 | + node-version-file: '.nvmrc' |
| 51 | + cache: 'npm' |
| 52 | + |
| 53 | + - name: 'Install Dependencies' |
| 54 | + run: 'npm ci' |
| 55 | + |
| 56 | + - name: 'Prepare Release Info' |
| 57 | + id: 'release_info' |
| 58 | + run: | |
| 59 | + RELEASE_VERSION="${{ github.event.inputs.version }}" |
| 60 | + echo "RELEASE_VERSION=${RELEASE_VERSION#v}" >> "${GITHUB_OUTPUT}" |
| 61 | + echo "PREVIOUS_TAG=$(git describe --tags --abbrev=0)" >> "${GITHUB_OUTPUT}" |
| 62 | +
|
| 63 | + - name: 'Run Tests' |
| 64 | + if: |- |
| 65 | + ${{ github.event.inputs.force_skip_tests != true }} |
| 66 | + uses: './.github/actions/run-tests' |
| 67 | + with: |
| 68 | + gemini_api_key: '${{ secrets.GEMINI_API_KEY }}' |
| 69 | + |
| 70 | + - name: 'Publish Release' |
| 71 | + uses: './.github/actions/publish-release' |
| 72 | + with: |
| 73 | + release-version: '${{ steps.release_info.outputs.RELEASE_VERSION }}' |
| 74 | + release-tag: '${{ github.event.inputs.version }}' |
| 75 | + npm-tag: '${{ github.event.inputs.npm_channel }}' |
| 76 | + wombat-token-core: '${{ secrets.WOMBAT_TOKEN_CORE }}' |
| 77 | + wombat-token-cli: '${{ secrets.WOMBAT_TOKEN_CLI }}' |
| 78 | + github-token: '${{ secrets.GITHUB_TOKEN }}' |
| 79 | + dry-run: '${{ github.event.inputs.dry_run }}' |
| 80 | + previous-tag: '${{ steps.release_info.outputs.PREVIOUS_TAG }}' |
0 commit comments