Skip to content

Commit

Permalink
CUS-1729 | Increment npm version locally before publishing to npm reg…
Browse files Browse the repository at this point in the history
…istry as pushing seems to fail
  • Loading branch information
emmaLP committed Feb 26, 2024
1 parent 4be60a7 commit ce91265
Showing 1 changed file with 2 additions and 37 deletions.
39 changes: 2 additions & 37 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,45 +3,8 @@ on:
release:
types: [published]
jobs:
increment-version:
permissions:
id-token: write
runs-on: ubuntu-latest
steps:
- name: Get GH Token
uses: actions/create-github-app-token@v1
id: app-token
with:
app-id: ${{ vars.GH_RELEASE_APP_ID }}
private-key: ${{ secrets.GH_RELEASE_APP_PRIVATE_KEY }}
owner: ${{ github.repository_owner }}
- name: Checkout
uses: actions/checkout@v4
with:
ref: main
token: ${{ steps.app-token.outputs.token }}
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: '18.x'
cache: 'npm'
registry-url: 'https://registry.npmjs.org'
- uses: chainguard-dev/actions/setup-gitsign@main
- name: Increment version
shell: bash
env:
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
run: |
git config --global user.name "datadogclientjsrepopush[bot]"
git config --global user.email "161316041+datadogclientjsrepopush[bot]@users.noreply.github.com"
npm version ${{ github.event.release.tag_name }} -m "[ci skip] v%s"
git tag -af ${{ github.event.release.tag_name }} -m "[ci skip] v%s"
git push --force
git push origin --tags --force
publish:
runs-on: ubuntu-latest
needs:
- increment-version
steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -53,6 +16,8 @@ jobs:
node-version: '18.x'
cache: 'npm'
registry-url: 'https://registry.npmjs.org'
- name: Increment Version
run: npm version ${{ github.event.release.tag_name }} --git-tag-version=false
- name: Install dependencies and build 🔧
run: npm ci
- name: Publish package on NPM 📦
Expand Down

0 comments on commit ce91265

Please sign in to comment.