|
| 1 | +name: Prepare create-tutorial Release PR |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_dispatch: |
| 5 | + inputs: |
| 6 | + version: |
| 7 | + description: 'Version to publish, e.g. 0.0.1' |
| 8 | + required: true |
| 9 | + default: '0.0.1' |
| 10 | + type: string |
| 11 | + push: |
| 12 | + branches: |
| 13 | + - main |
| 14 | + paths: |
| 15 | + - 'packages/create-tutorial/package.json' |
| 16 | + |
| 17 | +jobs: |
| 18 | + prepare_release_create_tutorial: |
| 19 | + name: Prepare Release PR |
| 20 | + runs-on: ubuntu-latest |
| 21 | + if: ${{ github.event_name == 'workflow_dispatch' }} |
| 22 | + steps: |
| 23 | + - name: Checkout |
| 24 | + uses: actions/checkout@v4 |
| 25 | + with: |
| 26 | + fetch-depth: 0 |
| 27 | + |
| 28 | + - uses: ./.github/actions/setup-and-build |
| 29 | + |
| 30 | + - name: Bump versions |
| 31 | + run: > |
| 32 | + pnpm --recursive |
| 33 | + --filter "create-tutorial" |
| 34 | + exec pnpm version --no-git-tag-version --allow-same-version ${{ inputs.version }} |
| 35 | +
|
| 36 | + - name: Create Pull Request |
| 37 | + uses: peter-evans/create-pull-request@c5a7806660adbe173f04e3e038b0ccdcd758773c |
| 38 | + with: |
| 39 | + commit-message: 'chore: release `create-tutorial` v${{ inputs.version }}' |
| 40 | + title: 'chore: release `create-tutorial` v${{ inputs.version }}' |
| 41 | + body: 'Bump `create-tutorial` to version ${{ inputs.version }}.' |
| 42 | + reviewers: SamVerschueren,d3lm,Nemikolh,AriPerkkio |
| 43 | + branch: chore/release-create-tutorial-${{ inputs.version }} |
| 44 | + |
| 45 | + publish_release_create_tutorial: |
| 46 | + name: Publish Release create-tutorial |
| 47 | + runs-on: ubuntu-latest |
| 48 | + permissions: |
| 49 | + contents: write |
| 50 | + id-token: write |
| 51 | + if: ${{ contains(github.event.head_commit.message, 'release `create-tutorial`') }} |
| 52 | + steps: |
| 53 | + - name: Checkout |
| 54 | + uses: actions/checkout@v4 |
| 55 | + with: |
| 56 | + fetch-depth: 0 |
| 57 | + |
| 58 | + - uses: ./.github/actions/setup-and-build |
| 59 | + |
| 60 | + - name: Publish to npm |
| 61 | + run: > |
| 62 | + pnpm --recursive |
| 63 | + --filter create-tutorial |
| 64 | + exec pnpm publish --provenance --access public |
| 65 | + env: |
| 66 | + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |
0 commit comments