From aab7e95b57454630b3f3937797e651bca6974ab4 Mon Sep 17 00:00:00 2001 From: Johannes Dannelov Date: Wed, 18 Dec 2024 10:53:37 +0100 Subject: [PATCH] chore: test 22 Signed-off-by: Johannes Dannelov --- .github/workflows/publishjar.yml | 34 ++++++-------------------------- 1 file changed, 6 insertions(+), 28 deletions(-) diff --git a/.github/workflows/publishjar.yml b/.github/workflows/publishjar.yml index 683d889..da61775 100644 --- a/.github/workflows/publishjar.yml +++ b/.github/workflows/publishjar.yml @@ -9,12 +9,10 @@ on: secrets: WORKFLOW_TOKEN: required: true - jobs: publish-container: name: Build and Publish Container Image runs-on: ubuntu-latest - permissions: contents: read packages: write @@ -30,36 +28,16 @@ jobs: distribution: "temurin" cache: maven server-id: github - server-username: ${{ github.repository_owner }} + server-username: ${{ github.actor }} server-password: ${{ secrets.WORKFLOW_TOKEN }} - - name: Show Generated Settings - run: | - echo "Maven settings content:" - cat ~/.m2/settings.xml - echo "Using token for repository: ${{ github.repository }}" - echo "Using owner: ${{ github.repository_owner }}" - - - name: Build, Generate SBOM + - name: Build, Generate SBOM, and Deploy + env: + GITHUB_TOKEN: ${{ secrets.WORKFLOW_TOKEN }} + GITHUB_ACTOR: ${{ github.actor }} run: | mvn -B clean package - - name: Publish Package with Curl - run: | - # First publish the POM - curl -v \ - -X PUT \ - -H "Authorization: Bearer ${{ secrets.WORKFLOW_TOKEN }}" \ - -H "Content-Type: application/xml" \ - --data-binary "@pom.xml" \ - "https://maven.pkg.github.com/danneleaf/oid-fed-base-test/com/github/danneleaf/oid-fed-base-test/2.0.2/oid-fed-base-test-2.0.2.pom" - - # Then publish the JAR - curl -v \ - -X PUT \ - -H "Authorization: Bearer ${{ secrets.WORKFLOW_TOKEN }}" \ - -H "Content-Type: application/java-archive" \ - --data-binary "@target/oid-fed-base-test-2.0.2.jar" \ - "https://maven.pkg.github.com/danneleaf/oid-fed-base-test/com/github/danneleaf/oid-fed-base-test/2.0.2/oid-fed-base-test-2.0.2.jar" + mvn -B -e deploy - name: Upload SBOM uses: actions/upload-artifact@v4