This repository has been archived by the owner on Nov 19, 2024. It is now read-only.
Update release.yaml #12
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: | ||
workflow_dispatch: | ||
inputs: | ||
level: | ||
type: choice | ||
description: "New version bump" | ||
required: true | ||
options: | ||
- major | ||
- minor | ||
- patch | ||
default: patch | ||
jobs: | ||
build: | ||
uses: .github/workflows/build.yml@master | ||
Check failure on line 18 in .github/workflows/release.yaml GitHub Actions / .github/workflows/release.yamlInvalid workflow file
|
||
bump: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
outputs: | ||
version: ${{ steps.semver.outputs.new_version }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Find last version | ||
id: get-version | ||
run: echo "version=$(jq --raw-output '.version' plugin.json)" >> $GITHUB_OUTPUT | ||
- uses: actions-ecosystem/action-bump-semver@v1 | ||
id: semver | ||
with: | ||
current_version: ${{ steps.get-version.outputs.version }} | ||
level: ${{ github.event.inputs.level }} | ||
- name: Bump plugin.json version | ||
run: | | ||
jq --rawfile readme README.md '.version = "${{ steps.semver.outputs.new_version }}" | .longdescription = $readme' plugin.json > plugin.json.tmp | ||
mv plugin.json.tmp plugin.json | ||
- name: Commit changes | ||
uses: stefanzweifel/git-auto-commit-action@v5 | ||
with: | ||
branch: master | ||
commit_message: Bump version to ${{ steps.semver.outputs.new_version }} | ||
tagging_message: "v${{ steps.semver.outputs.new_version }}" | ||
release: | ||
runs-on: ubuntu-latest | ||
needs: | ||
- bump | ||
- build | ||
permissions: | ||
contents: write | ||
steps: | ||
- uses: actions/download-artifact@v4 | ||
with: | ||
merge-multiple: true | ||
- name: Create release | ||
uses: ncipollo/release-action@v1 | ||
with: | ||
artifacts: "*" | ||
artifactErrorsFailBuild: true | ||
tag: "${{ needs.bump.outputs.version }}" |