Skip to content

Commit

Permalink
only publish on gh release
Browse files Browse the repository at this point in the history
  • Loading branch information
jksolbakken committed Mar 8, 2024
1 parent b055735 commit 0073c40
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 62 deletions.
61 changes: 0 additions & 61 deletions .github/workflows/master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,66 +44,5 @@ jobs:
- name: build
run: npm run build

increment-version:
runs-on: ubuntu-latest
permissions:
contents: write
needs: [build]
steps:
- name: Harden runner
uses: step-security/harden-runner@63c24ba6bd7ba022e95695ff85de572c04a18142 # ratchet:step-security/harden-runner@v2
with:
disable-sudo: true
egress-policy: block
allowed-endpoints: >
github.com:443
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # ratchet:actions/checkout@v4
with:
persist-credentials: false
- uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # ratchet:actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
- name: Configure git
run: |
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git config --global user.name "github-actions[bot]"
git remote set-url origin https://github-actions[bot]:${{ secrets.GITHUB_TOKEN }}@github.com/$GITHUB_REPOSITORY.git
- run: npm version patch -m "[skip ci] bump version %s"
- run: git push

publish-to-npm:
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
packages: write
needs: [increment-version]
steps:
- name: Harden runner
uses: step-security/harden-runner@63c24ba6bd7ba022e95695ff85de572c04a18142 # ratchet:step-security/harden-runner@v2
with:
disable-sudo: true
egress-policy: block
allowed-endpoints: >
github.com:443
npm.pkg.github.com:443
fulcio.sigstore.dev:443
rekor.sigstore.dev:443
registry.npmjs.org:443
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # ratchet:actions/checkout@v4
with:
persist-credentials: false
- uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # ratchet:actions/setup-node@v4
with:
registry-url: "https://npm.pkg.github.com"
scope: "@navikt"
node-version: ${{ env.NODE_VERSION }}
- name: install deps
run: npm ci
- name: build
run: npm run build
- run: npm publish --provenance --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}


2 changes: 1 addition & 1 deletion .github/workflows/prs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,6 @@ jobs:
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: ${{ runner.os }}-node-
- name: Install deps
run: npm ci
run: npm install
- name: Run tests
run: npm test

0 comments on commit 0073c40

Please sign in to comment.