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

ci: publish container with all version tags TDE-527 #299

Merged
merged 11 commits into from
Jan 19, 2023
18 changes: 14 additions & 4 deletions .github/workflows/containers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,18 @@ jobs:

- name: Publish Containers
run: |
versions=("latest")
GIT_VERSION=$(git describe --tags --always --match 'v*')
docker tag topo-imagery ghcr.io/linz/topo-imagery:${GIT_VERSION}
docker push ghcr.io/linz/topo-imagery:${GIT_VERSION}
docker tag topo-imagery ghcr.io/linz/topo-imagery:latest
docker push ghcr.io/linz/topo-imagery:latest
if [ ${{(github.ref == 'refs/heads/master' && contains(github.event.head_commit.message, 'release:'))}} == true ]; then
Copy link
Collaborator Author

@paulfouquet paulfouquet Jan 16, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have to use contains and not startsWith as when the release-please PR gets merged, the commit message not only contains the release: ... commit:

commit 68f58f69bbaec5a5895a1ef3572949ec516ac39a (HEAD -> master, tag: v0.4.0, origin/master, origin/HEAD)
Merge: 94fb2a7 1ca37f3
Author: paulfouquet <86932794+paulfouquet@users.noreply.github.com>
Date:   Mon Jan 16 10:54:41 2023 +1300

    Merge pull request #29 from paulfouquet/release-please--branches--master
    
    release: 0.4.0

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

your commit here looks to be a Merge commit, we do not allow merge commits in this repo.

When merging it should be merged as a Squash+Rebase, here is an example commit with a squash/rebase

linz/style-js@169ad32

so startsWith is what we want.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't do my test in a exact same environment that's why...

XYZ_VERSION=${GIT_VERSION%-*-*}
XY_VERSION=${XYZ_VERSION%.*}
X_VERSION=${XY_VERSION%.*}
versions+=(${X_VERSION} ${XY_VERSION} ${XYZ_VERSION})
fi
versions+=(${GIT_VERSION})

for version in "${versions[@]}"; do
docker tag topo-imagery ghcr.io/linz/topo-imagery:$version
docker push ghcr.io/linz/topo-imagery:$version
echo "Tag $version created"
done
1 change: 1 addition & 0 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ jobs:
with:
release-type: python
token: ${{ secrets.GITHUB_TOKEN }}
pull-request-title-pattern: "release: ${version}"

publish-release:
paulfouquet marked this conversation as resolved.
Show resolved Hide resolved
needs: release-please
Expand Down
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
CHANGELOG.md
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is to avoid prettier to complain about * VS - in the changelog generated by release-please