-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
The bug was inadvertently introduced by #405, when we migrated to a later version of the [Docker `build-push-action`][1]. [1]: https://github.com/docker/build-push-action Fixes #419
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,93 +1,95 @@ | ||
--- | ||
name: Release | ||
|
||
on: # yamllint disable-line rule:truthy | ||
pull_request_target: | ||
types: | ||
- closed | ||
|
||
env: | ||
docker_repo: agilepathway/pull-request-label-checker | ||
|
||
jobs: | ||
|
||
tag: | ||
name: Tag semantic version | ||
runs-on: ubuntu-22.04 | ||
outputs: | ||
semver: ${{ steps.tag.outputs.tag }} | ||
steps: | ||
- name: Tag | ||
uses: K-Phoen/[email protected] | ||
id: tag | ||
with: | ||
release_branch: master | ||
release_strategy: tag | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
release: | ||
needs: tag | ||
name: Create GitHub Release | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- | ||
name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- | ||
name: Set up Go | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version: '1.21.5' | ||
- | ||
name: Run GoReleaser | ||
uses: goreleaser/[email protected] | ||
with: | ||
version: latest | ||
args: release --rm-dist | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
build_and_push_docker_image: | ||
needs: tag | ||
name: Build and push image | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v3 | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
- name: Login to Docker Hub | ||
uses: docker/login-action@v3 | ||
with: | ||
username: ${{ secrets.DOCKER_USERNAME }} | ||
password: ${{ secrets.DOCKER_PASSWORD }} | ||
- name: Build and push Docker image | ||
uses: docker/build-push-action@v5 | ||
with: | ||
tags: ${{env.docker_repo}}:${{ needs.tag.outputs.semver }} | ||
platforms: linux/amd64,linux/arm64 | ||
push: true | ||
|
||
check_latest_tag: | ||
needs: [tag, build_and_push_docker_image] | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
|
||
- name: Check Docker image for new release is tagged latest | ||
id: check_docker_image_tagged_latest | ||
# yamllint disable rule:line-length | ||
run: | | ||
docker pull ${{env.docker_repo}}:${{ needs.tag.outputs.semver }} | ||
echo "IS_LATEST_TAGGED_CORRECTLY=$(docker image inspect ${{env.docker_repo}}:${{ needs.tag.outputs.semver }} | jq -r '.[] | (.RepoTags) | any( . == "${{env.docker_repo}}:latest") ')" >> "$GITHUB_OUTPUT" | ||
# yamllint enable rule:line-length | ||
|
||
- name: Fail if latest is not tagged correctly | ||
if: ${{ steps.check_docker_image_tagged_latest.outputs.IS_LATEST_TAGGED_CORRECTLY == 'false' }} | ||
uses: actions/github-script@v7 | ||
with: | ||
script: | | ||
core.setFailed('The newly released Docker image ${{ needs.tag.outputs.semver }} is not tagged latest. ') | ||
name: Release | ||
Check failure on line 2 in .github/workflows/github_tag_and_release.yml GitHub Actions / yamllint[yamllint] .github/workflows/github_tag_and_release.yml#L2
Raw output
|
||
|
||
Check failure on line 3 in .github/workflows/github_tag_and_release.yml GitHub Actions / yamllint[yamllint] .github/workflows/github_tag_and_release.yml#L3
Raw output
|
||
on: # yamllint disable-line rule:truthy | ||
pull_request_target: | ||
types: | ||
- closed | ||
|
||
Check failure on line 8 in .github/workflows/github_tag_and_release.yml GitHub Actions / yamllint[yamllint] .github/workflows/github_tag_and_release.yml#L8
Raw output
|
||
env: | ||
docker_repo: agilepathway/pull-request-label-checker | ||
|
||
Check failure on line 11 in .github/workflows/github_tag_and_release.yml GitHub Actions / yamllint[yamllint] .github/workflows/github_tag_and_release.yml#L11
Raw output
|
||
jobs: | ||
|
||
Check failure on line 13 in .github/workflows/github_tag_and_release.yml GitHub Actions / yamllint[yamllint] .github/workflows/github_tag_and_release.yml#L13
Raw output
|
||
tag: | ||
name: Tag semantic version | ||
runs-on: ubuntu-22.04 | ||
outputs: | ||
semver: ${{ steps.tag.outputs.tag }} | ||
steps: | ||
- name: Tag | ||
uses: K-Phoen/[email protected] | ||
id: tag | ||
with: | ||
release_branch: master | ||
release_strategy: tag | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
Check failure on line 28 in .github/workflows/github_tag_and_release.yml GitHub Actions / yamllint[yamllint] .github/workflows/github_tag_and_release.yml#L28
Raw output
|
||
release: | ||
needs: tag | ||
name: Create GitHub Release | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- | ||
name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- | ||
name: Set up Go | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version: '1.21.5' | ||
- | ||
name: Run GoReleaser | ||
uses: goreleaser/[email protected] | ||
with: | ||
version: latest | ||
args: release --rm-dist | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
Check failure on line 52 in .github/workflows/github_tag_and_release.yml GitHub Actions / yamllint[yamllint] .github/workflows/github_tag_and_release.yml#L52
Raw output
|
||
build_and_push_docker_image: | ||
needs: tag | ||
name: Build and push image | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v3 | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
- name: Login to Docker Hub | ||
uses: docker/login-action@v3 | ||
with: | ||
username: ${{ secrets.DOCKER_USERNAME }} | ||
password: ${{ secrets.DOCKER_PASSWORD }} | ||
- name: Build and push Docker image | ||
uses: docker/build-push-action@v5 | ||
with: | ||
tags: ${{env.docker_repo}}:${{ needs.tag.outputs.semver }},${{env.docker_repo}}:latest | ||
platforms: linux/amd64,linux/arm64 | ||
push: true | ||
|
||
Check failure on line 74 in .github/workflows/github_tag_and_release.yml GitHub Actions / yamllint[yamllint] .github/workflows/github_tag_and_release.yml#L74
Raw output
|
||
check_latest_tag: | ||
needs: [tag, build_and_push_docker_image] | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
|
||
Check failure on line 79 in .github/workflows/github_tag_and_release.yml GitHub Actions / yamllint[yamllint] .github/workflows/github_tag_and_release.yml#L79
Raw output
|
||
- name: Check Docker image for new release is tagged latest | ||
# (it is important to have this check to catch any regression, e.g. if we move to a different way of releasing) | ||
Check failure on line 81 in .github/workflows/github_tag_and_release.yml GitHub Actions / yamllint[yamllint] .github/workflows/github_tag_and_release.yml#L81
Raw output
|
||
id: check_docker_image_tagged_latest | ||
# yamllint disable rule:line-length | ||
run: | | ||
docker pull ${{env.docker_repo}}:${{ needs.tag.outputs.semver }} | ||
echo "IS_LATEST_TAGGED_CORRECTLY=$(docker image inspect ${{env.docker_repo}}:${{ needs.tag.outputs.semver }} | jq -r '.[] | (.RepoTags) | any( . == "${{env.docker_repo}}:latest") ')" >> "$GITHUB_OUTPUT" | ||
# yamllint enable rule:line-length | ||
|
||
Check failure on line 88 in .github/workflows/github_tag_and_release.yml GitHub Actions / yamllint[yamllint] .github/workflows/github_tag_and_release.yml#L88
Raw output
|
||
- name: Fail if latest is not tagged correctly | ||
if: ${{ steps.check_docker_image_tagged_latest.outputs.IS_LATEST_TAGGED_CORRECTLY == 'false' }} | ||
uses: actions/github-script@v7 | ||
with: | ||
script: | | ||
core.setFailed('The newly released Docker image ${{ needs.tag.outputs.semver }} is not tagged latest. ') | ||
Check failure on line 95 in .github/workflows/github_tag_and_release.yml GitHub Actions / yamllint[yamllint] .github/workflows/github_tag_and_release.yml#L95
Raw output
Check failure on line 95 in .github/workflows/github_tag_and_release.yml GitHub Actions / yamllint[yamllint] .github/workflows/github_tag_and_release.yml#L95
Raw output
|