Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Backport 3.29] [Backport 3.28] Publish to GitHub Package #2417

Merged
merged 1 commit into from
May 4, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 22 additions & 2 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ jobs:

steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Get tag
id: tag2
Expand All @@ -37,6 +39,23 @@ jobs:
- run: gpg --export-secret-keys --armor D121AF2DFA8E140688BD968930C9B913FD42EF13 > CI.asc
if: env.HAS_SECRETS == 'HAS_SECRETS'

- 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.HAS_SECRETS == 'HAS_SECRETS'

Expand Down Expand Up @@ -104,11 +123,12 @@ jobs:
- name: Publish
run: c2cciutils-publish
if: env.HAS_SECRETS == 'HAS_SECRETS'
- 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
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ wrapper {

allprojects {
group = 'org.mapfish.print'
version = '3.29.2'
version = '1.0.0'
ext.junitVersion = "4.13.2"
ext.groovyVersion = "3.0.9"
ext.spotbugsVersion = '4.5.3'
Expand Down
5 changes: 0 additions & 5 deletions ci/config.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
version:
tag_to_version_re:
- from: release/([0-9]+\.[0-9]+\.[0-9]+)
to: \1

checks:
required_workflows:
audit.yaml:
Expand Down
4 changes: 1 addition & 3 deletions publish/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down