Skip to content

Fix wrong push mode (#1335) #687

Fix wrong push mode (#1335)

Fix wrong push mode (#1335) #687

# This workflow will build a package using Maven and then publish it to
# qbic-repo.qbic.uni-tuebingen.de packages when a release is created
# For more information see: https://github.com/actions/setup-java#apache-maven-with-a-settings-path
name: Deploy Snapshot
on:
push:
branches:
- development
permissions:
id-token: write # This is required for requesting the JWT
contents: read # This is required for actions/checkout
attestations: write # required for provenance
jobs:
publish_snapshot:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v5
- name: Debug OIDC (get a token)
uses: actions/github-script@v7
with:
script: |
const token = await core.getIDToken('sigstore'); // audience example
core.setSecret(token);
console.log('OIDC token acquired. Length:', token.length);
- name: Set up JDK 21
uses: actions/setup-java@v5
with:
distribution: 'zulu'
java-version: '21'
settings-path: ${{ github.workspace }}
- name: Load local Maven repository cache
uses: actions/cache@v4
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
# Remove existing snapshot tags which are not supposed to be present
- name: Remove snapshot tags
run: mvn versions:set -DremoveSnapshot
# Set the SNAPSHOT for this build and deployment
- name: Set version in Maven project
run: mvn versions:set -DnewVersion='${project.version}-SNAPSHOT'
- name: Build with Maven
run: VAADIN_OFFLINE_KEY=${{ secrets.VAADIN_SERVER_23_2 }} mvn -B package -Pproduction -Dvaadin.force.production.build=true --file pom.xml
# Generate provenance (SLSA attestation) for all JARs
- name: Generate SLSA build provenance
uses: actions/attest-build-provenance@v1
with:
subject-path: "**/target/*.jar"
- name: Publish artefact to QBiC Nexus Repository
run: VAADIN_OFFLINE_KEY=${{ secrets.VAADIN_SERVER_23_2 }} mvn --quiet --settings $GITHUB_WORKSPACE/.github.settings.xml -Pproduction -Dvaadin.force.production.build=true -DskipTests deploy
env:
MAVEN_REPO_USERNAME: ${{ secrets.NEXUS_USERNAME }}
MAVEN_REPO_PASSWORD: ${{ secrets.NEXUS_PASSWORD }}