Skip to content

Commit

Permalink
chore: test 22
Browse files Browse the repository at this point in the history
Signed-off-by: Johannes Dannelov <[email protected]>
  • Loading branch information
danneleaf committed Dec 18, 2024
1 parent 1528911 commit aab7e95
Showing 1 changed file with 6 additions and 28 deletions.
34 changes: 6 additions & 28 deletions .github/workflows/publishjar.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit aab7e95

Please sign in to comment.