From 1efecb669b9ad5d7ab1a61f62f71242af6a41c2b 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 | 6 +++--- .github/workflows/release.yml | 20 ++++++++++++++++++++ 2 files changed, 23 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/build_mainline.yml b/.github/workflows/build_mainline.yml index 4109481..b91acdc 100644 --- a/.github/workflows/build_mainline.yml +++ b/.github/workflows/build_mainline.yml @@ -1,9 +1,8 @@ -name: Build [mainline] + name: Build [mainline] 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 }}