Skip to content

Commit

Permalink
feat(ci): publish on version change only
Browse files Browse the repository at this point in the history
  • Loading branch information
jenspots committed Nov 11, 2024
1 parent 64f17e2 commit cd90377
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 3 deletions.
13 changes: 10 additions & 3 deletions .github/workflows/publish-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ name: Publish Docker Image
on:
workflow_dispatch:
push:
paths:
- 'gradle.properties'
branches:
- main

Expand All @@ -12,13 +14,18 @@ jobs:
permissions:
contents: read
packages: write

steps:
- name: Check out the repository
uses: actions/checkout@v3
with:
submodules: recursive

- name: Extract version from gradle.properties
id: extract_version
run: |
VERSION=$(grep '^projectVersion=' gradle.properties | cut -d'=' -f2)
echo "version=$VERSION" >> $GITHUB_ENV
- name: Log in to GitHub Docker registry
uses: docker/login-action@v2
with:
Expand All @@ -28,8 +35,8 @@ jobs:

- name: Build the Docker image
run: |
docker build -t ghcr.io/rdf-connect/orchestrator:latest .
docker build -t ghcr.io/rdf-connect/orchestrator:${{ env.version }} .
- name: Push the Docker image
run: |
docker push ghcr.io/rdf-connect/orchestrator:latest
docker push ghcr.io/rdf-connect/orchestrator:${{ env.version }}
35 changes: 35 additions & 0 deletions .github/workflows/publish-maven.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Publish Maven Packages

on:
push:
paths:
- 'gradle.properties'
branches:
- main

jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
env:
GITHUB_ACTOR: ${{ github.actor }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v4

- uses: actions/setup-java@v4
with:
java-version: '22'
distribution: 'adopt'
cache: 'gradle'

- name: Setup Gradle
uses: gradle/actions/setup-gradle@417ae3ccd767c252f5661f1ace9f835f9654f2b5 # v3.1.0

- name: Publish `rdfc-processor`
run: gradle :rdfc-processor:publish

- name: Publish `rdfc-core`
run: gradle :rdfc-core:publish

0 comments on commit cd90377

Please sign in to comment.