Skip to content

chore(release): 3.1.0 #26

chore(release): 3.1.0

chore(release): 3.1.0 #26

Workflow file for this run

name: 'Create github and npm releases'
on:
push:
tags:
- "v*"
jobs:
check-release:
name: 'Check release is good and ready'
uses: ./.github/workflows/check-pr.yml
with:
skip-deduplication: true
make-release:
name: 'Make github and npm releases'
runs-on: ubuntu-latest
permissions:
contents: write
needs: check-release
steps:
- name: 'Checkout source code'
uses: 'actions/checkout@v4'
- name: 'Prepare workflow'
uses: ./.github/actions/prepare
- name: 'Make .d.ts'
run: yarn make-types
- name: 'Publish package'
run: "yarn publish --tag ${{ ((contains(github.ref_name, '-alpha') || contains(github.ref_name, '-beta')) && 'next') || 'latest' }} --access public"
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Generate Changelog
run: |
START=$(grep -n "## \[" CHANGELOG.md | head -n 1 | cut -d : -f 1)
END=$(grep -n "## \[" CHANGELOG.md | head -n 2 | tail -n 1 | cut -d : -f 1)
awk "NR > $START && NR < $END" CHANGELOG.md | sed -e :a -e '/./,$!d;/^\n*$/{$d;N;};/\n$/ba' > ${{ github.workspace }}-CHANGELOG.temp.md
- name: 'Create a github release'
uses: softprops/action-gh-release@v2
with:
token: "${{ secrets.GITHUB_TOKEN }}"
prerelease: ${{ contains(github.ref_name, '-alpha') || contains(github.ref_name, '-beta') }}
tag_name: "${{ github.ref_name }}"
body_path: ${{ github.workspace }}-CHANGELOG.temp.md