You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
52 lines
1.4 KiB
52 lines
1.4 KiB
name: 'Publish release'
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
inputs:
|
|
version:
|
|
type: choice
|
|
description: 'The version you want to publish to NPM'
|
|
options:
|
|
- patch
|
|
- minor
|
|
- prepatch
|
|
- preminor
|
|
distTag:
|
|
type: choice
|
|
description: 'NPM dist-tag'
|
|
default: 'latest'
|
|
options:
|
|
- latest
|
|
- beta
|
|
- rc
|
|
- alpha
|
|
|
|
jobs:
|
|
publish:
|
|
name: 'Publish'
|
|
runs-on: ubuntu-latest
|
|
if: github.repository == 'strapi/strapi'
|
|
steps:
|
|
- uses: actions/create-github-app-token@v1
|
|
id: app-token
|
|
with:
|
|
app-id: ${{ secrets.RELEASE_APP_ID }}
|
|
private-key: ${{ secrets.RELEASE_APP_SECRET }}
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
token: ${{ steps.app-token.outputs.token }}
|
|
fetch-depth: 0 # Fetch full history
|
|
- name: Setup npmrc
|
|
run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > .npmrc
|
|
- uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 20
|
|
- run: yarn
|
|
- run: ./scripts/publish.sh
|
|
env:
|
|
VERSION: ${{ github.event.inputs.version }}
|
|
DIST_TAG: ${{ github.event.inputs.distTag }}
|
|
PREID: ${{ github.event.inputs.distTag }}
|
|
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
|
|
GITHUB_ACTOR: ${{ github.actor }}
|