Skip to content

release

release #1

Workflow file for this run

name: release
on:
workflow_run:
workflows: [ci]
types:
- completed
branches: [main]
permissions:
contents: write
pull-requests: write
jobs:
release-please:
if: ${{ github.event.workflow_run.conclusion == 'success' }}
runs-on: ubuntu-latest
outputs:
release_created: ${{ steps.release.outputs.release_created }}
tag_name: ${{ steps.release.outputs.tag_name }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Package name
id: name
run: echo "::set-output name=name::$(jq -r .name package.json)"
- name: Create release PR
uses: google-github-actions/release-please-action@v4
id: release
with:
release-type: node
config-file: .github/release-please-config.json
target-branch: main
upload-artifact:
runs-on: ubuntu-latest
needs: release-please
if: ${{ needs.release-please.outputs.release_created == 'true' }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup NodeJS 18.18.2
uses: actions/setup-node@v4
with:
node-version: 18.18.2
cache: npm
cache-dependency-path: package-lock.json
- name: Install dependencies
run: npm ci
- name: Save archive
run: echo "archive=$(npm pack 2>/dev/null | tail -1)" >> $GITHUB_ENV
- name: Upload ${{ env.archive }} to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
tag: refs/tags/${{ needs.release-please.outputs.tag_name }}
file: ${{ env.archive }}