Skip to content

Pre Release

Pre Release #3

Workflow file for this run

name: "πŸ–¨οΈ Pre Release"
on:
workflow_dispatch:
inputs:
targetVersion:
description: 'Expected Release Version'
required: true
env:
GIT_USER_NAME: 'grails-build'
GIT_USER_EMAIL: '[email protected]'
jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: write
packages: write
steps:
# - name: "πŸ’₯ Purge Existing Builds - org.grails.grails-gsp"
# run: |
# curl -L \
# -X DELETE \
# -H "Accept: application/vnd.github+json" \
# -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
# -H "X-GitHub-Api-Version: 2022-11-28" \
# https://api.github.com/orgs/${{ github.repository_owner }}/packages/maven/org.grails.grails-gsp || true
- name: "πŸ“₯ Checkout repository"
uses: actions/checkout@v4
- name: "πŸ›‘ Set Prevent Snapshot Publishing Flag"
run: |
sed -i "s/^preventSnapshotPublish.*$/preventSnapshotPublish\=true/" gradle.properties
- name: "πŸ“© Commit flag to prevent snapshot publishing"
run: |
git config user.name "${{ env.GIT_USER_NAME }}"
git config user.email "${{ env.GIT_USER_EMAIL }}"
git add gradle.properties
if ! git diff --cached --quiet; then
git commit -m "[skip ci] Pre Release - ${{ github.event.inputs.targetVersion }} - Preventing Snapshot Publishing"
git push origin HEAD
else
echo "Publishing already disabled."
fi
- name: "β˜•οΈ Setup JDK"
uses: actions/setup-java@v4
with:
distribution: 'liberica'
java-version: '17'
- name: "🐘 Setup Gradle"
uses: gradle/actions/setup-gradle@v4
with:
develocity-access-key: ${{ secrets.DEVELOCITY_ACCESS_KEY }}
- name: "βš™ Set version to ${{ github.event.inputs.targetVersion }}"
run: |
sed -i "s/^projectVersion.*$/projectVersion\=${{ github.event.inputs.targetVersion }}/" gradle.properties
cat gradle.properties
- name: "🧩 Run Assemble"
if: success()
run: ./gradlew assemble
env:
DEVELOCITY_BUILD_CACHE_NODE_USER: ${{ secrets.GRADLE_ENTERPRISE_BUILD_CACHE_NODE_USER }}
DEVELOCITY_BUILD_CACHE_NODE_KEY: ${{ secrets.GRADLE_ENTERPRISE_BUILD_CACHE_NODE_KEY }}
- name: "πŸ” Generate key file for artifact signing"
env:
SECRING_FILE: ${{ secrets.SECRING_FILE }}
run: echo $SECRING_FILE | base64 -d > ${{ github.workspace }}/secring.gpg
- name: "πŸ“€ Publish to GitHub Packages"
id: publish
env:
DEVELOCITY_BUILD_CACHE_NODE_USER: ${{ secrets.GRADLE_ENTERPRISE_BUILD_CACHE_NODE_USER }}
DEVELOCITY_BUILD_CACHE_NODE_KEY: ${{ secrets.GRADLE_ENTERPRISE_BUILD_CACHE_NODE_KEY }}
GITHUB_USERNAME: ${{ secrets.GITHUB_ACTOR }}
GITHUB_PASSWORD: ${{ secrets.GITHUB_TOKEN }}
GITHUB_PUBLISH: 'true'
SIGNING_KEY: ${{ secrets.SIGNING_KEY }}
SIGNING_PASSPHRASE: ${{ secrets.SIGNING_PASSPHRASE }}
SECRING_FILE: ${{ secrets.SECRING_FILE }}
run: >
./gradlew
-Psigning.secretKeyRingFile=${{ github.workspace }}/secring.gpg
publish