Release sigstore gradle plugins to Gradle Plugin Portal #2
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 sigstore gradle plugins to Gradle Plugin Portal | |
on: | |
workflow_dispatch: | |
jobs: | |
process-tag: | |
runs-on: ubuntu-latest | |
outputs: | |
version: ${{ steps.version.outputs.version }} | |
steps: | |
- name: checkout tag | |
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 | |
- name: process tag | |
id: version | |
run: | | |
TAG=${{ github.ref_name }} | |
echo "version=${TAG#"v"}" >> $GITHUB_OUTPUT | |
- name: verify tag matches gradle version | |
run: | | |
set -Eeo pipefail | |
version=$(grep "^version=" gradle.properties | cut -d'=' -f2) | |
if [[ ! "$version" == "${{ steps.version.outputs.version }}" ]]; then | |
echo "tagged version ${{ github.ref }} (as ${{ steps.version.outputs.version }}) does not match gradle.properties $version" | |
exit 1 | |
fi | |
ci: | |
needs: [process-tag] | |
permissions: | |
id-token: write # To run github oidc tests | |
uses: ./.github/workflows/ci.yaml | |
build: | |
permissions: | |
id-token: write # To sign the artifacts | |
runs-on: ubuntu-latest | |
needs: [ci] | |
steps: | |
- name: Checkout tag | |
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 | |
- name: Set up JDK 11 | |
uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 # v4.2.1 | |
with: | |
java-version: 11 | |
distribution: 'temurin' | |
- name: Setup Gradle | |
uses: gradle/actions/setup-gradle@db19848a5fa7950289d3668fb053140cf3028d43 # v3.3.2 | |
- name: Build, Sign and Release to Gradle Plugin Portal | |
run: | | |
./gradlew publishPlugins -Prelease -Pgradle.publish.key=$GRADLE_PUBLISH_KEY -Pgradle.publish.secret=$GRADLE_PUBLISH_SECRET | |
env: | |
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.PGP_PRIVATE_KEY }} | |
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.PGP_PASSPHRASE }} | |
GRADLE_PUBLISH_KEY: ${{ secrets.GRADLE_PUBLISH_KEY }} | |
GRADLE_PUBLISH_SECRET: ${{ secrets.GRADLE_PUBLISH_SECRET }} | |
create-release-on-github: | |
runs-on: ubuntu-latest | |
needs: [build] | |
permissions: | |
contents: write | |
steps: | |
- name: Create release | |
uses: softprops/action-gh-release@9d7c94cfd0a1f3ed45544c887983e9fa900f0564 # v2.0.4 | |
with: | |
tag_name: ${{ github.ref_name }} | |
name: ${{ github.ref_name }}-gradle | |
body: "See [CHANGELOG.md](https://github.com/${{ vars.GITHUB_REPOSITORY }}/blob/main/CHANGELOG.md) for more details." |