From 60bdd72d536526796ffe465c87cf06cf11671289 Mon Sep 17 00:00:00 2001 From: Jan Cizmar Date: Thu, 18 Dec 2025 12:17:38 +0100 Subject: [PATCH 1/5] chore: Update the semantic release, so the Trusted Publisher works --- .github/workflows/prerelease.yml | 11 ++++++++++- .github/workflows/release.yml | 2 +- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/.github/workflows/prerelease.yml b/.github/workflows/prerelease.yml index b8a31f08..faa77459 100644 --- a/.github/workflows/prerelease.yml +++ b/.github/workflows/prerelease.yml @@ -3,6 +3,14 @@ on: push: branches: [ next, prerelease ] +# This part sets up the Trusted Publishers for npm via GitHub Actions, +# that's why we don't need to set up the token manually +permissions: + id-token: write + contents: write + issues: write + pull-requests: write + jobs: prerelease: runs-on: ubuntu-latest @@ -12,6 +20,8 @@ jobs: with: node-version: 22 + - run: npm install -g npm@^11.5.1 + - name: Cache dependencies uses: actions/cache@v4 with: @@ -26,7 +36,6 @@ jobs: run: npm run release env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - NPM_TOKEN: ${{ secrets.NPM_TOKEN }} GIT_AUTHOR_NAME: Tolgee Machine GIT_AUTHOR_EMAIL: machine@tolgee.io GIT_COMMITTER_NAME: Tolgee Machine diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e36dac60..0b643aba 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -24,7 +24,7 @@ jobs: with: node-version: 22 - - run: install -g npm@^11.5.1 + - run: npm install -g npm@^11.5.1 - name: Cache dependencies uses: actions/cache@v4 From f92064b1223c96aca1d93b98c2e3f38e7012779f Mon Sep 17 00:00:00 2001 From: Jan Cizmar Date: Thu, 18 Dec 2025 12:40:17 +0100 Subject: [PATCH 2/5] chore: Update the semantic release, so the Trusted Publisher works --- .github/workflows/prerelease.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/prerelease.yml b/.github/workflows/prerelease.yml index faa77459..12cb6f0c 100644 --- a/.github/workflows/prerelease.yml +++ b/.github/workflows/prerelease.yml @@ -19,6 +19,7 @@ jobs: - uses: actions/setup-node@v4 with: node-version: 22 + registry-url: 'https://registry.npmjs.org' - run: npm install -g npm@^11.5.1 From dca970eb4b484a15c65edbd71e9246f93fb428da Mon Sep 17 00:00:00 2001 From: Jan Cizmar Date: Thu, 18 Dec 2025 12:44:08 +0100 Subject: [PATCH 3/5] chore: Let's try it with npm v24 --- .github/workflows/prerelease.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/prerelease.yml b/.github/workflows/prerelease.yml index 12cb6f0c..faef99b1 100644 --- a/.github/workflows/prerelease.yml +++ b/.github/workflows/prerelease.yml @@ -18,11 +18,9 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 with: - node-version: 22 + node-version: '24' registry-url: 'https://registry.npmjs.org' - - run: npm install -g npm@^11.5.1 - - name: Cache dependencies uses: actions/cache@v4 with: From cd2e163c270acb2be65425445dcee50e8c6901ab Mon Sep 17 00:00:00 2001 From: Jan Cizmar Date: Thu, 18 Dec 2025 12:49:09 +0100 Subject: [PATCH 4/5] chore: Use single workflow file for releasing --- .github/workflows/prerelease.yml | 41 -------------------------------- .github/workflows/release.yml | 7 +++--- 2 files changed, 4 insertions(+), 44 deletions(-) delete mode 100644 .github/workflows/prerelease.yml diff --git a/.github/workflows/prerelease.yml b/.github/workflows/prerelease.yml deleted file mode 100644 index faef99b1..00000000 --- a/.github/workflows/prerelease.yml +++ /dev/null @@ -1,41 +0,0 @@ -name: Pre-release -on: - push: - branches: [ next, prerelease ] - -# This part sets up the Trusted Publishers for npm via GitHub Actions, -# that's why we don't need to set up the token manually -permissions: - id-token: write - contents: write - issues: write - pull-requests: write - -jobs: - prerelease: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-node@v4 - with: - node-version: '24' - registry-url: 'https://registry.npmjs.org' - - - name: Cache dependencies - uses: actions/cache@v4 - with: - path: ~/.npm - key: cache-node-modules-${{ runner.os }}-${{ hashFiles('**/package-lock.json') }} - - name: Install dependencies - run: npm ci - - - name: Build the CLI - run: npm run build - - name: Run npm release - run: npm run release - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - GIT_AUTHOR_NAME: Tolgee Machine - GIT_AUTHOR_EMAIL: machine@tolgee.io - GIT_COMMITTER_NAME: Tolgee Machine - GIT_COMMITTER_EMAIL: machine@tolgee.io diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 0b643aba..a629e8a6 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -5,6 +5,8 @@ on: branches: [ main ] types: - completed + push: + branches: [ next, prerelease ] # This part sets up the Trusted Publishers for npm via GitHub Actions, # that's why we don't need to set up the token manually @@ -22,9 +24,8 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 with: - node-version: 22 - - - run: npm install -g npm@^11.5.1 + node-version: '24' + registry-url: 'https://registry.npmjs.org' - name: Cache dependencies uses: actions/cache@v4 From 97bcb11b02d062b3fb480446b39bdf08e5a8bc24 Mon Sep 17 00:00:00 2001 From: Jan Cizmar Date: Thu, 18 Dec 2025 12:50:43 +0100 Subject: [PATCH 5/5] chore: fix the condition --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a629e8a6..de481a72 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -18,7 +18,7 @@ permissions: jobs: release: - if: ${{ github.event.workflow_run.conclusion == 'success' }} + if: ${{ github.event.workflow_run.conclusion == 'success' || github.event_name == 'push' }} runs-on: ubuntu-latest steps: - uses: actions/checkout@v4