Skip to content

Release Zimic to GitHub #7

Release Zimic to GitHub

Release Zimic to GitHub #7

name: Release Zimic to GitHub
on:
pull_request:
types:
- closed
branches:
- canary
- v*
workflow_dispatch:
inputs:
upgrade-type:
description: Upgrade type
type: choice
required: true
default: prerelease
options:
- prerelease
- stable
- patch
- minor
- major
pre-release-id:
description: Pre-release id
type: choice
required: true
default: canary
options:
- canary
- none
concurrency:
group: release-to-github
cancel-in-progress: false
env:
TURBO_TOKEN: ${{ secrets.TURBO_REMOTE_CACHE_TOKEN }}
TURBO_TEAM: ${{ secrets.TURBO_REMOTE_CACHE_TEAM }}
TURBO_LOG_ORDER: stream
jobs:
release-to-github:
name: Release to GitHub
runs-on: ubuntu-latest
timeout-minutes: 5
environment: GitHub
permissions:
contents: write
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ssh-key: ${{ secrets.RELEASE_GITHUB_PUSH_KEY }}
- name: Set up Zimic
uses: ./.github/actions/zimic-setup
with:
turbo-token: ${{ env.TURBO_TOKEN }}
turbo-team: ${{ env.TURBO_TEAM }}
install: zimic...
- name: Get Zimic release settings
id: release-settings
uses: ./.github/actions/zimic-get-release-settings
with:
project-name: zimic
input-upgrade-type: ${{ inputs.upgrade-type }}
input-pre-release-id: ${{ inputs.pre-release-id }}
- name: Bump Zimic version
id: bump-version
if: ${{ steps.release-settings.outputs.upgrade-type != '' }}
uses: ./.github/actions/zimic-bump-version
with:
project-name: zimic
project-directory: packages/zimic
upgrade-type: ${{ steps.release-settings.outputs.upgrade-type }}
pre-release-id: ${{ steps.release-settings.outputs.pre-release-id }}
commit-user-name: ${{ vars.RELEASE_COMMIT_USER_NAME }}
commit-user-email: ${{ vars.RELEASE_COMMIT_USER_EMAIL }}
- name: Create GitHub release
if: ${{ steps.release-settings.outputs.upgrade-type != '' }}
uses: ncipollo/release-action@v1
with:
name: v${{ steps.bump-version.outputs.value }}
tag: v${{ steps.bump-version.outputs.value }}
commit: ${{ steps.bump-version.outputs.commit-sha }}
token: ${{ secrets.GITHUB_TOKEN }}
makeLatest: ${{ steps.release-settings.outputs.pre-release-id == 'none' }}
prerelease: ${{ steps.release-settings.outputs.pre-release-id != 'node' }}
generateReleaseNotes: true
draft: true