Skip to content

Commit

Permalink
Fixed release-asset-publish.yml and docker-image-publish.yml.
Browse files Browse the repository at this point in the history
  • Loading branch information
And1sS committed Aug 29, 2024
1 parent 3e5e980 commit fdf4bc6
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 10 deletions.
16 changes: 11 additions & 5 deletions .github/workflows/docker-image-publish.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
name: Publish Docker image for new tag/release

on:
push:
tags:
- '*'
workflow_run:
workflows: [Publish release]
types:
- completed

env:
REGISTRY: ghcr.io
Expand All @@ -13,6 +14,7 @@ jobs:
build:
name: Publish Docker image for new tag/release
runs-on: ubuntu-latest
if: "contains(github.event.workflow_run.head_commit.message, 'Prebid Server prepare release ')"
permissions:
contents: read
packages: write
Expand All @@ -32,6 +34,10 @@ jobs:
- name: Check out Repository
uses: actions/checkout@v4

- name: Get latest tag
uses: actions-ecosystem/action-get-latest-tag@v1
id: get-latest-tag

- name: Set up JDK
uses: actions/setup-java@v3
with:
Expand Down Expand Up @@ -61,5 +67,5 @@ jobs:
context: .
file: ${{ matrix.dockerfile-path }}
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
tags: ghcr.io/prebid/prebid-server-java:${{ steps.get-latest-tag.outputs.tag }}
labels: ${{ steps.get-latest-tag.outputs.tag }}
20 changes: 15 additions & 5 deletions .github/workflows/release-asset-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,18 @@ jobs:
build:
name: Publish release .jar
runs-on: ubuntu-latest
if: "contains(github.event.workflow_run.head_commit.message, 'Prebid Server prepare release ')"
strategy:
matrix:
java: [ 21 ]
steps:
- uses: actions/checkout@v4
- name: Check out Repository
uses: actions/checkout@v4

- name: Get latest tag
uses: actions-ecosystem/action-get-latest-tag@v1
id: get-latest-tag

- name: Set up JDK
uses: actions/setup-java@v3
with:
Expand All @@ -24,21 +31,24 @@ jobs:

- name: Build base .jar via Maven
run: mvn clean package -Dcheckstyle.skip -Dmaven.test.skip=true

- name: Upload and attach base .jar to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: target/prebid-server.jar
asset_name: prebid-server-${{ github.ref_name }}.jar
tag: ${{ github.ref }}
asset_name: prebid-server-${{ steps.get-latest-tag.outputs.tag }}.jar
overwrite: true
tag: ${{ steps.get-latest-tag.outputs.tag }}

- name: Build bundled .jar via Maven
run: mvn clean package --file extra/pom.xml -Dcheckstyle.skip -Dmaven.test.skip=true

- name: Upload and attach bundled .jar to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: extra/bundle/target/prebid-server-bundle.jar
asset_name: prebid-server-bundle-${{ github.ref_name }}.jar
asset_name: prebid-server-bundle-${{ steps.get-latest-tag.outputs.tag }}.jar
overwrite: true
tag: ${{ github.ref }}
tag: ${{ steps.get-latest-tag.outputs.tag }}

0 comments on commit fdf4bc6

Please sign in to comment.