Auth with Google for SOPS #4
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: Publish | |
on: | |
push: | |
tags: | |
- 'v*' | |
jobs: | |
publish: | |
if: github.repository == 'codebandits/gradle-container-plugin' | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup JDK | |
uses: actions/setup-java@v4 | |
with: | |
distribution: temurin | |
java-version: 21 | |
cache: gradle | |
- name: Install SOPS | |
uses: mdgreenwald/mozilla-sops-action@v1 | |
- name: Load Infrastructure Configuration | |
uses: codebandits/github-actions/load-env@main | |
id: configuration | |
with: | |
path: ./.github/configuration.env | |
- uses: google-github-actions/auth@v2 | |
with: | |
project_id: ${{ steps.configuration.outputs.GCP_PROJECT_ID }} | |
workload_identity_provider: ${{ steps.configuration.outputs.GCP_WORKLOAD_IDENTITY_PROVIDER }} | |
service_account: ${{ steps.configuration.outputs.GCP_SERVICE_ACCOUNT }} | |
- name: Set Version | |
run: | | |
TAG="${{ github.ref_name }}" | |
echo "VERSION=${TAG#v}" >> $GITHUB_ENV | |
- name: Run Bootstrap | |
run: ./bootstrap.sh | |
- name: Publish Plugin | |
run: ./gradlew publishPlugins -Pversion=$VERSION --validate-only |