From 16b69da87dfb86c56b4bede639bfb2ea2c12470c Mon Sep 17 00:00:00 2001 From: Stijn Dejongh Date: Sat, 21 Sep 2024 19:46:49 +0200 Subject: [PATCH] DEVOPS: add github package deploy --- .github/workflows/build_mainline.yml | 4 ++-- .github/workflows/release.yml | 20 ++++++++++++++++++++ 2 files changed, 22 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/build_mainline.yml b/.github/workflows/build_mainline.yml index 4109481..034f11d 100644 --- a/.github/workflows/build_mainline.yml +++ b/.github/workflows/build_mainline.yml @@ -3,7 +3,6 @@ on: push: branches: - main - - main_** jobs: build: @@ -15,9 +14,10 @@ jobs: steps: - uses: actions/checkout@v4 + env: + GITHUB_TOKEN: ${{ secrets.REPO_TOKEN }} # Needed to get PR information, if any with: ref: ${{ github.head_ref }} - token: ${{ secrets.REPO_TOKEN }} - name: Set up JDK 21 uses: actions/setup-java@v4 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..f594767 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,20 @@ +name: Publish package to GitHub Packages +on: + release: + types: [created] +jobs: + publish: + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-java@v4 + with: + java-version: '21' + distribution: 'temurin' + - name: Publish package + run: mvn --batch-mode deploy + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}