Skip to content

Refactor workflows

Refactor workflows #16

Workflow file for this run

name: Publish
on:
push:
tags:
- 'v*'
jobs:
check:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup JDK
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 21
cache: gradle
- name: Setup Docker
uses: docker/setup-buildx-action@v3
- name: Run Bootstrap
run: ./bootstrap.sh
- name: Run Gradle Check
run: ./gradlew check
publish:
if: github.repository == 'codebandits/gradle-container-plugin'
needs: check
runs-on: ubuntu-latest
permissions:
contents: write
id-token: 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: 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: Install SOPS
uses: mdgreenwald/mozilla-sops-action@v1
- 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