diff --git a/.github/workflows/release-next.yml b/.github/workflows/release-next.yml deleted file mode 100644 index c2af59d..0000000 --- a/.github/workflows/release-next.yml +++ /dev/null @@ -1,26 +0,0 @@ -name: Release Next -on: - push: - branches: - - next -jobs: - release: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-node@v3 - with: - node-version: '18.x' - cache: yarn - registry-url: 'https://registry.npmjs.org' - - name: Set outputs - id: vars - run: echo "::set-output name=sha_short::$(git rev-parse --short HEAD)" - - run: git config --global user.name "GitHub CD bot" - - run: git config --global user.email "info@networkteam.com" - - run: npm version prerelease --preid=${{ steps.vars.outputs.sha_short }} - - run: yarn install - - run: yarn build - - run: npm publish --tag next - env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7778a53..bb74ce8 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,10 +1,19 @@ name: Release on: release: - types: [created] + types: [released] + push: + branches: + - next + +permissions: + id-token: write + contents: read + jobs: release: runs-on: ubuntu-latest + if: github.event_name == 'release' && github.event.action == 'released' steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v3 @@ -15,5 +24,23 @@ jobs: - run: yarn install - run: yarn build - run: npm publish - env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + + release-next: + runs-on: ubuntu-latest + if: github.ref == 'refs/heads/next' + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v3 + with: + node-version: '18.x' + cache: yarn + registry-url: 'https://registry.npmjs.org' + - name: Set outputs + id: vars + run: echo "::set-output name=sha_short::$(git rev-parse --short HEAD)" + - run: git config --global user.name "GitHub CD bot" + - run: git config --global user.email "info@networkteam.com" + - run: npm version prerelease --preid=${{ steps.vars.outputs.sha_short }} + - run: yarn install + - run: yarn build + - run: npm publish --tag next