Prepare release #2
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: Prepare release | |
on: | |
workflow_dispatch: | |
inputs: | |
releaseType: | |
description: 'Type of release' | |
required: true | |
default: 'patch' | |
type: choice | |
options: | |
- major | |
- minor | |
- patch | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }}-root | |
cancel-in-progress: true | |
jobs: | |
prepare_release: | |
runs-on: ubuntu-latest | |
outputs: | |
ref: ${{ steps.push-tag.outputs.commit_long_sha }} | |
steps: | |
- name: Generate a token | |
id: generate-token | |
uses: actions/create-github-app-token@v1 | |
with: | |
app-id: ${{ secrets.PUSH_O_MATIC_APP_ID }} | |
private-key: ${{ secrets.PUSH_O_MATIC_APP_KEY }} | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
token: ${{ steps.generate-token.outputs.token }} | |
- uses: actions-rust-lang/setup-rust-toolchain@v1 | |
- run: cargo install cargo-edit | |
- name: Bump version | |
run: cargo set-version --bump "${{ inputs.releaseType }}" && npm version ${{ inputs.releaseType }} --no-git-tag-version | |
- name: Get version | |
run: echo "IMMICH_VERSION=$(cargo metadata --format-version 1 --no-deps | jq -r '.packages.[0].version')" >> $GITHUB_ENV | |
- name: Commit and tag | |
id: push-tag | |
uses: EndBug/add-and-commit@v9 | |
with: | |
default_author: github_actions | |
message: 'chore: version ${{ env.IMMICH_VERSION }}' | |
tag: ${{ env.IMMICH_VERSION }} | |
push: true | |
- name: Create draft release | |
uses: softprops/action-gh-release@v2 | |
with: | |
draft: true | |
tag_name: ${{ env.IMMICH_VERSION }} | |
token: ${{ steps.generate-token.outputs.token }} | |
generate_release_notes: true |