Release #8
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 | |
on: workflow_dispatch | |
jobs: | |
release: | |
name: Release | |
runs-on: ubuntu-latest | |
steps: | |
- name: Verify prerequisites | |
run: | | |
if [[ $GITHUB_REF_NAME != release/* ]]; then | |
echo This workflow should only be run against release branches | |
exit 1 | |
fi | |
- uses: actions/checkout@v4 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v4 | |
with: | |
java-version: '17' | |
distribution: 'temurin' | |
- name: Run release | |
run: ./gradlew publishPlugins --validate-only -Prelease=true | |
env: | |
GRADLE_PUBLISH_KEY: ${{ secrets.GRADLE_PUBLISH_KEY }} | |
GRADLE_PUBLISH_SECRET: ${{ secrets.GRADLE_PUBLISH_SECRET }} | |
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }} | |
GPG_PASSWORD: ${{ secrets.GPG_PASSWORD }} | |
post_release: | |
name: Post release | |
runs-on: ubuntu-latest | |
needs: | |
- release | |
permissions: | |
contents: write | |
pull-requests: write | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v4 | |
with: | |
java-version: '17' | |
distribution: 'temurin' | |
- name: Creating a GH release | |
id: variables | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
git config user.email "[email protected]" | |
git config user.name "Cesar Munoz" | |
version=$(cat gradle.properties | grep -Po "(?<=version=)\d+\.\d+\.\d+") | |
tag="v$version" | |
git tag $tag | |
git push origin tag $tag | |
gh release create --target $GITHUB_REF_NAME \ | |
--title "$version" \ | |
$tag | |
- name: Bump version | |
run: | | |
./gradlew versionBump | |
git commit -a -m "Bumping version" | |
git push | |
- name: Create PR to main | |
run: | | |
message="Prepare for the next release" | |
gh pr create --title "$message" \ | |
--body "$message." \ | |
--base main |