diff --git a/.github/workflows/publish-docker.yml b/.github/workflows/publish-docker.yml index b496720..c6d6033 100644 --- a/.github/workflows/publish-docker.yml +++ b/.github/workflows/publish-docker.yml @@ -3,6 +3,8 @@ name: Publish Docker Image on: workflow_dispatch: push: + paths: + - 'gradle.properties' branches: - main @@ -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: @@ -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 }} diff --git a/.github/workflows/publish-maven.yml b/.github/workflows/publish-maven.yml new file mode 100644 index 0000000..b70473e --- /dev/null +++ b/.github/workflows/publish-maven.yml @@ -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