From 384e71a359322f10eb1fbfb5c4a97d472bccc8db Mon Sep 17 00:00:00 2001 From: Jonathan Philipp Date: Fri, 23 Jan 2026 14:59:54 +0100 Subject: [PATCH] chore: update ci-workflow for trusted-publishing --- .github/workflows/release-next.yml | 25 --------------------- .github/workflows/release.yml | 36 +++++++++++++++++++++++++----- 2 files changed, 31 insertions(+), 30 deletions(-) delete mode 100644 .github/workflows/release-next.yml diff --git a/.github/workflows/release-next.yml b/.github/workflows/release-next.yml deleted file mode 100644 index bbdf73f..0000000 --- a/.github/workflows/release-next.yml +++ /dev/null @@ -1,25 +0,0 @@ -name: Release Next -on: - push: - branches: - - next -jobs: - release: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - uses: actions/setup-node@v2 - with: - node-version: '20.x' - 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 9a2d304..a40b7e4 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,18 +1,44 @@ 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@v2 - - uses: actions/setup-node@v2 + - uses: actions/checkout@v4 + - uses: actions/setup-node@v3 with: node-version: '20.x' registry-url: 'https://registry.npmjs.org' - 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: '20.x' + 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