diff --git a/.github/workflows/docker-release.yml b/.github/workflows/docker-release.yml index b5adf4a..8730123 100644 --- a/.github/workflows/docker-release.yml +++ b/.github/workflows/docker-release.yml @@ -53,11 +53,12 @@ jobs: labels: ${{ steps.meta.outputs.labels }} # This step generates an artifact attestation for the image, which is an unforgeable statement about where and how it was built. It increases supply chain security for people who consume the image. For more information, see "[AUTOTITLE](/actions/security-guides/using-artifact-attestations-to-establish-provenance-for-builds)." - - name: Generate artifact attestation - uses: actions/attest-build-provenance@v1 - with: - #subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME}} - subject-name: ${{ env.REGISTRY }}/${{ github.repository_owner }}/${{ env.IMAGE_NAME }} - subject-digest: ${{ steps.push.outputs.digest }} - push-to-registry: true +# Broken: generates images with sha256, that fail to start with "unsupported media type application/vnd.oci.empty.v1+json" +# - name: Generate artifact attestation +# uses: actions/attest-build-provenance@v1 +# with: +# #subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME}} +# subject-name: ${{ env.REGISTRY }}/${{ github.repository_owner }}/${{ env.IMAGE_NAME }} +# subject-digest: ${{ steps.push.outputs.digest }} +# push-to-registry: true diff --git a/.github/workflows/maven-release.yml b/.github/workflows/maven-release.yml index b2df34f..d241985 100644 --- a/.github/workflows/maven-release.yml +++ b/.github/workflows/maven-release.yml @@ -23,10 +23,22 @@ jobs: distribution: 'temurin' settings-path: ${{ github.workspace }} # location for the settings.xml file +# Maven versioning is broken in so many ways (Maven is older than git). In semver you want to increase version only when there +# are changes in module. Maven forces to change submodule version even when only change was main pom version change +# Here: deploy for each submodule is necessary +# to deploy submodules even when main module didn't change - name: Publish to GitHub Packages Apache Maven - run: mvn deploy -s $GITHUB_WORKSPACE/settings.xml + run: | + mvn deploy -s $GITHUB_WORKSPACE/settings.xml + mvn -f cdoc2-shared-crypto deploy -Dmaven.test.skip=true -s $GITHUB_WORKSPACE/settings.xml + mvn -f server-openapi deploy -Dmaven.test.skip=true -s $GITHUB_WORKSPACE/settings.xml + mvn -f server-db deploy -Dmaven.test.skip=true -s $GITHUB_WORKSPACE/settings.xml + mvn -f server-common deploy -Dmaven.test.skip=true -s $GITHUB_WORKSPACE/settings.xml + mvn -f put-server deploy -Dmaven.test.skip=true -s $GITHUB_WORKSPACE/settings.xml + mvn -f get-server deploy -Dmaven.test.skip=true -s $GITHUB_WORKSPACE/settings.xml env: GITHUB_TOKEN: ${{ github.token }} + MAVEN_REPO: open-eid/cdoc2-capsule-server # maven repo to download dependencies # test if username and password are correct (may still fail if no write access or wrong package name) - name: Log in to the Container registry diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index 13baa3e..798d6b6 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -20,16 +20,26 @@ env: jobs: fork_setup: runs-on: ubuntu-latest - if: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork == true }} + outputs: base_repo: ${{ steps.base_repo.outputs.name }} is_fork: ${{ steps.is_fork.outputs.is_fork }} steps: - id: base_repo - run: echo "name=${{github.event.pull_request.base.repo.full_name}}" >> "$GITHUB_OUTPUT" + run: | + if [ ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork == true }} ]; then + echo "name=${{github.event.pull_request.base.repo.full_name}}" >> "$GITHUB_OUTPUT" + else + echo "name=${{ github.event.repo.name }}" >> "$GITHUB_OUTPUT" + fi - id: is_fork - run: echo "is_fork=true" >> "$GITHUB_OUTPUT" + run: | + if [ ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork == true }} ]; then + echo "is_fork=true" >> "$GITHUB_OUTPUT" + else + echo "is_fork=false" >> "$GITHUB_OUTPUT" + fi build: runs-on: ubuntu-latest @@ -56,6 +66,7 @@ jobs: GITHUB_TOKEN: ${{ github.token }} # GITHUB_TOKEN is the default env for the password IS_FORK: ${{needs.fork_setup.outputs.is_fork}} BASE_REPO: ${{needs.fork_setup.outputs.base_repo}} + MAVEN_REPO: ${{vars.MAVEN_REPO}} # set as repository variable: open-eid/cdoc2-capsule-server # Optional: Uploads the full dependency graph to GitHub to improve the quality of Dependabot alerts this repository can receive diff --git a/get-server/pom.xml b/get-server/pom.xml index 8f73f58..7dc53c3 100644 --- a/get-server/pom.xml +++ b/get-server/pom.xml @@ -467,7 +467,7 @@ false - true + false diff --git a/pom.xml b/pom.xml index c0664d3..93f4ef9 100644 --- a/pom.xml +++ b/pom.xml @@ -297,7 +297,7 @@ false - true + false diff --git a/put-server/pom.xml b/put-server/pom.xml index 32650a8..cf78d80 100644 --- a/put-server/pom.xml +++ b/put-server/pom.xml @@ -464,7 +464,7 @@ false - true + false