Skip to content

Release package

Release package #15

Workflow file for this run

name: Release package
on:
workflow_run:
branches:
- main
workflows:
- CI
types:
- completed
jobs:
check-commit:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' }}
outputs:
skip: ${{ steps.commit-message.outputs.skip }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Get commit message
id: commit-message
run: |
MESSAGE=$(git log --format=%B -n 1 $(git log -1 --pretty=format:"%h"))
if [[ $MESSAGE == "chore: release "* ]]; then
echo "skip=true" >> $GITHUB_OUTPUT
fi
release:
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
needs: check-commit
if: ${{ needs.check-commit.outputs.skip != 'true' }}
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
- name: Setup
uses: ./.github/actions/setup
- name: Configure Git
run: |
git config user.name "${GITHUB_ACTOR}"
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com"
- name: Create release
run: |
npm config set //registry.npmjs.org/:_authToken $NPM_TOKEN
yarn release-it --ci
env:
GITHUB_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
NPM_CONFIG_PROVENANCE: true