Skip to content
This repository has been archived by the owner on Oct 21, 2024. It is now read-only.

Create release

Create release #52

name: "Create release"
on:
workflow_dispatch:
inputs:
release-type:
type: choice
description: Pre release?
options:
- No pre release
- alpha
- beta
- rc
dry:
type: boolean
description: Dry run
default: true
jobs:
build-release:
runs-on: ubuntu-latest
outputs:
release-tag: ${{ steps.release-tag.outputs.tag }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
token: ${{ secrets.GH_BUILD }}
- name: git config
run: |
git config user.name "github-action"
git config user.email "[email protected]"
- name: Use Node.js 18.x
uses: actions/setup-node@v3
with:
node-version: 18.x
- name: Add npm publish token to .npmrc
run: npm config set //registry.npmjs.org/:_authToken ${{ secrets.NPM_TOKEN }}
- name: yarn release
run: |
yarn install --immutable --immutable-cache --check-cache
echo dry-run is ${{ inputs.dry }}
[[ "${{ inputs.dry }}" == "true" ]] && \
DRY="--dry-run" || DRY=""
[[ "${{ inputs.release-type }}" == "No pre release" ]] && \
yarn release $DRY || \
yarn release --preRelease=${{ inputs.release-type }} $DRY
tag=`git tag --points-at HEAD`
echo "tag=${tag}" >> $GITHUB_ENV
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Set release tag on job output
id: release-tag
run: echo "tag=${tag}" >> "$GITHUB_OUTPUT"
api-gov:
name: Run API Compliance to Update Baseline
needs: build-release
uses: ./.github/workflows/api-gov.yml
secrets: inherit
with:
update_baseline: true
tag: ${{ needs.build-release.outputs.release-tag }}