diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index d4e3a3711e..ec0dab21b9 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -16,6 +16,8 @@ jobs: steps: - uses: actions/checkout@v2 + with: + fetch-depth: 0 - name: Get tag id: tag2 @@ -36,6 +38,23 @@ jobs: - run: gpg --export-secret-keys --armor D121AF2DFA8E140688BD968930C9B913FD42EF13 > CI.asc if: env.SECRETS == 'TRUE' + - id: tag + run: echo "##[set-output name=tag;]$(echo ${{ github.ref }}|sed 's%refs/tags/%%g')" + if: startsWith(github.ref, 'refs/tags/') + - run: sed --in-place 's/version = .*/version = "${{ steps.tag.outputs.tag }}"/g' build.gradle + if: startsWith(github.ref, 'refs/tags/') + + - id: last-tag + run: echo "##[set-output name=tag;]$(git describe --tags --abbrev=0)" + if: "!startsWith(github.ref, 'refs/tags/')" + - id: no-tag + run: echo "##[set-output name=nb;]$(git log --oneline ${{ steps.last-tag.outputs.tag }}..HEAD|wc -l)" + if: "!startsWith(github.ref, 'refs/tags/')" + - run: sed --in-place 's/version = .*/version = "${{ steps.last-tag.outputs.tag }}"/g' build.gradle + if: "!startsWith(github.ref, 'refs/tags/') && steps.no-tag.outputs.nb == 0" + - run: sed --in-place 's/version = .*/version = "${{ steps.last-tag.outputs.tag }}+${{ steps.no-tag.outputs.nb }}"/g' build.gradle + if: "!startsWith(github.ref, 'refs/tags/') && steps.no-tag.outputs.nb > 0" + - run: echo "enablePublishing=true" > gradle.properties if: env.SECRETS == 'TRUE' @@ -105,11 +124,12 @@ jobs: - name: Publish run: c2cciutils-publish if: env.SECRETS == 'TRUE' + - run: git diff + - run: docker run --rm --env=GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }} mapfish_print_builder bash -c 'gradle build && gradle publish' + if: ( startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/master' ) && env.SECRETS == 'TRUE' - id: version run: echo "##[set-output name=version;]$(grep version build.gradle|sed "s/ \+version = .\(.*\)./\1/g")" - - id: tag - run: echo "##[set-output name=tag;]$(echo ${{ github.ref }}|sed 's%refs/tags/%%g')" - name: Create Release id: create_release uses: actions/create-release@v1 diff --git a/build.gradle b/build.gradle index 7c69fadd2e..cecc10aa6e 100644 --- a/build.gradle +++ b/build.gradle @@ -23,7 +23,7 @@ wrapper { allprojects { group = 'org.mapfish.print' - version = '3.27.2' + version = '1.0.0' ext.junitVersion = "4.13.1" ext.groovyVersion = "3.0.7" ext.spotbugsVersion = '4.1.4' diff --git a/ci/config.yaml b/ci/config.yaml index 8e197c9e56..6eecd2a697 100644 --- a/ci/config.yaml +++ b/ci/config.yaml @@ -1,8 +1,3 @@ -version: - tag_to_version_re: - - from: release/([0-9]+\.[0-9]+\.[0-9]+) - to: \1 - checks: required_workflows: audit.yaml: diff --git a/publish/README.md b/publish/README.md index 15f218a4bf..c9dd0e18f5 100644 --- a/publish/README.md +++ b/publish/README.md @@ -7,9 +7,7 @@ which is the staging repository for maven central. # Automated Process -1. Edit the root `build.gradle` to change the `allprojects/version` and commit that with a - `release/${version}` tag. -2. Push the commit and the tag to GitHub. +1. Create a `x.y.z` tag. ## Docker daily build