make version target more specific #14
Workflow file for this run
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 pipeline" | |
on: | |
push: | |
tags: | |
- 'v*.*.*' | |
jobs: | |
version: | |
name: Get version number from tag | |
runs-on: ubuntu-22.04 | |
outputs: | |
version: ${{ steps.vars.outputs.version }} | |
steps: | |
- name: Read version | |
id: vars | |
# extract tag name without v prefix | |
run: echo "version=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT | |
shell: bash | |
readme: | |
needs: version | |
name: Replace version in README.md | |
runs-on: ubuntu-22.04 | |
permissions: | |
contents: write | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.head_ref }} | |
- uses: jacobtomlinson/gha-find-replace@v3 | |
with: | |
find: "version \"[0-9]+.[0-9]+.[0-9]+\"" | |
replace: "${{ needs.version.outputs.version }}" | |
include: "**README.md" | |
- name: Push changes | |
uses: stefanzweifel/git-auto-commit-action@v4 | |
with: | |
commit_message: Update plugin version. | |
branch: master | |
release-build: | |
runs-on: ubuntu-22.04 | |
needs: readme | |
steps: | |
- name: git clone | |
uses: actions/[email protected] | |
- name: Set up JDKs | |
uses: actions/[email protected] | |
with: | |
distribution: temurin | |
java-version: 8 | |
- name: Set up Gradle | |
uses: gradle/[email protected] | |
- run: "./gradlew :publishPlugin -PpluginVersion=${{ needs.version.outputs.version }}" | |
env: | |
GRADLE_PUBLISH_KEY: ${{ secrets.GRADLE_PUBLISH_KEY }} | |
GRADLE_PUBLISH_SECRET: ${{ secrets.GRADLE_PUBLISH_SECRET }} |