Publish tokens #56
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Publish tokens | |
on: | |
workflow_dispatch: | |
inputs: | |
npm-tag: | |
description: 'Tag for npm package (next | latest)' | |
required: true | |
default: 'next' | |
env: | |
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} | |
jobs: | |
setup: | |
uses: ./.github/workflows/_setup.yml | |
secrets: inherit | |
with: | |
cacheKey: ${{ github.sha }}-setup-tokens | |
checkout_paths: packages | |
tag: ${{ github.event.inputs.npm-tag }} | |
packages: | |
name: Process packages | |
runs-on: ubuntu-latest | |
needs: [setup] | |
steps: | |
- name: Use "setup" cache | |
id: setup-cache | |
uses: actions/cache@v4 | |
with: | |
path: | | |
./* | |
~/.pnpm-store | |
key: ${{ github.sha }}-setup-tokens | |
- name: Use "dist" cache | |
id: dist-cache | |
uses: actions/cache@v4 | |
with: | |
path: | | |
./* | |
~/.pnpm-store | |
key: ${{ github.sha }}-dist-production-tokens | |
- name: Build packages | |
id: build-packages | |
run: node_modules/.bin/pnpm run build | |
- name: log-errors-to-slack | |
uses: act10ns/slack@v2 | |
with: | |
status: ${{ job.status }} | |
steps: ${{ toJson(steps) }} | |
if: failure() | |
publish: | |
name: Publish to npm | |
runs-on: ubuntu-latest | |
needs: [packages, setup] | |
steps: | |
- name: Use "dist" cache | |
id: dist-cache | |
uses: actions/cache@v4 | |
with: | |
path: | | |
./* | |
~/.pnpm-store | |
key: ${{ github.sha }}-dist-production-tokens | |
- name: Publish to npm | |
id: publish-to-npm | |
run: | | |
node_modules/.bin/pnpm config set '//registry.npmjs.org/:_authToken' ${{ secrets.NPM_TOKEN }} | |
node_modules/.bin/pnpm --filter @equinor/eds-tokens publish --access public --tag ${{ needs.setup.outputs.tag }} --no-git-checks | |
- name: log-errors-to-slack | |
uses: act10ns/slack@v2 | |
with: | |
status: ${{ job.status }} | |
steps: ${{ toJson(steps) }} | |
if: failure() |