Publish #7
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 | |
on: | |
workflow_dispatch: | |
inputs: | |
target_element: | |
description: 'Semver element will be incremented' | |
required: true | |
default: patch | |
type: choice | |
options: | |
- major | |
- minor | |
- patch | |
jobs: | |
publish: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
id-token: write | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: '18.x' | |
registry-url: 'https://registry.npmjs.org' | |
- name: Configure git | |
run: | | |
git config --global user.name 'github-actions[bot]' | |
git config --global user.email '41898282+github-actions[bot]@users.noreply.github.com' | |
- name: Bump version | |
run: npm -w packages/bolt-s3 version ${{ inputs.target_element }} | |
- name: Get version string | |
id: get-version-string | |
run: echo "version=$(jq -r .version packages/bolt-s3/package.json)" >> "$GITHUB_OUTPUT" | |
- run: git add package-lock.json packages/bolt-s3/package.json | |
- run: git commit -m "v${{ steps.get-version-string.outputs.version }}" | |
- run: git tag "v${{ steps.get-version-string.outputs.version }}" | |
- run: npm ci | |
- run: make publish | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
- run: git push | |
- run: git push origin "v${{ steps.get-version-string.outputs.version }}" |