Merge pull request #289 from Crossbell-Box/develop #195
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: Release | |
on: | |
push: | |
branches: | |
- main | |
concurrency: ${{ github.workflow }}-${{ github.ref }} | |
jobs: | |
release: | |
name: Release | |
runs-on: macos-latest | |
permissions: | |
pull-requests: write | |
contents: write | |
actions: write | |
steps: | |
- name: Checkout Repo | |
uses: actions/checkout@v3 | |
- name: Setup Node.js 16 | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 16 | |
cache: yarn | |
- name: Install Dependencies | |
run: yarn | |
- name: Resolve release type | |
uses: actions/github-script@v6 | |
id: release-type | |
with: | |
result-encoding: string | |
script: | | |
const resolveReleaseInfo = require('./scripts/resolve-release-type.js') | |
const releaseInfo = await resolveReleaseInfo(); | |
core.setOutput('type', releaseInfo.type); | |
core.setOutput('oldVersion', releaseInfo.oldVersion); | |
core.setOutput('newVersion', releaseInfo.newVersion); | |
- name: Print release type | |
run: | | |
echo ${{ steps.release-type.outputs.type }} | |
echo ${{ steps.release-type.outputs.oldVersion }} | |
echo ${{ steps.release-type.outputs.newVersion }} | |
- name: Bump Versions | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
uses: changesets/action@v1 | |
with: | |
title: 'chore: update versions from v${{ steps.release-type.outputs.oldVersion }} to v${{ steps.release-type.outputs.newVersion }}' | |
version: yarn run release:version | |
publish: yarn run release:publish | |
commit: 'chore: update versions [${{ steps.release-type.outputs.newVersion }}]' | |
- name: Trigger Publish Preview workflow | |
if: steps.release-type.outputs.type != '' | |
uses: benc-uk/workflow-dispatch@v1 | |
with: | |
workflow: preview.yml | |
inputs: '{ "release_type": "${{ steps.release-type.outputs.type }}" }' |