This repository has been archived by the owner on Jan 5, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: trigger snapshot rebuild even when version not bumped
- Loading branch information
Showing
8 changed files
with
130 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,20 +11,29 @@ jobs: | |
- name: Checkout Apiman Docker repo | ||
uses: actions/checkout@v3 | ||
|
||
- name: Default setup items | ||
run: bash .git/workflows/support/setup.sh | ||
|
||
- name: Update release version in docker-release flow | ||
run: echo ${{ github.event.client_payload.release_version }} > .github/workflows/RELEASE_VERSION | ||
run: echo ${{ github.event.client_payload.release-version }} > .github/workflows/RELEASE_VERSION | ||
|
||
- name: Tag release | ||
run: git tag -a -m "Apiman Docker ${{ github.event.client_payload.release-version }}" ${{ github.event.client_payload.release-version }} | ||
|
||
- name: Commit release version update to repository | ||
uses: EndBug/[email protected] | ||
with: | ||
author_name: apiman-ci | ||
default_author: user_info | ||
message: "chore(ci): update RELEASE_VERSION to ${{ github.event.client_payload.release_version }}" | ||
add: .workflows --force | ||
message: "chore(ci): update RELEASE_VERSION to ${{ github.event.client_payload.release-version }}" | ||
add: .github/workflows --force | ||
|
||
- name: Tag release | ||
run: git tag -a -m "Apiman Docker ${{ github.event.client_payload.release_version }}" | ||
|
||
- name: Create GitHub release ${{ github.event.client_payload.release_version }} | ||
- name: Create GitHub release ${{ github.event.client_payload.release-version }} | ||
uses: softprops/action-gh-release@v1 | ||
|
||
with: | ||
tag_name: ${{ github.event.client_payload.release-version }} | ||
name: ${{ github.event.client_payload.release-version }} | ||
body: | | ||
Apiman Docker release for Apiman version ${{ github.event.client_payload.release-version }}. | ||
To access the images associated with this build, please look on Apiman's DockerHub or our GHCR registry (GitHub Packages). |
52 changes: 52 additions & 0 deletions
52
.github/workflows/receive-dispatch-update-snapshot-version.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
name: update Apiman snapshot version | ||
|
||
on: | ||
workflow_dispatch: | ||
repository_dispatch: | ||
types: | ||
- apiman-snapshot-version | ||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
snapshot-version-changed: ${{ steps.check-version-change.outputs.snapshot-version-changed }} | ||
steps: | ||
- name: Checkout Apiman Docker repo | ||
uses: actions/checkout@v3 | ||
|
||
- name: Default setup items | ||
run: bash .github/workflows/support/setup.sh | ||
|
||
- name: Update snapshot version in docker-release flow if changed | ||
id: check-version-change | ||
run: | | ||
SNAPSHOT_VERSION_FILE=$(cat .github/workflows/SNAPSHOT_VERSION) | ||
if [[ "$SNAPSHOT_VERSION_FILE" != "${{ github.event.client_payload.snapshot-version }}" ]] | ||
then | ||
echo "Old version: $SNAPSHOT_VERSION_FILE - New version: ${{ github.event.client_payload.snapshot-version }}" | ||
echo ${{ github.event.client_payload.snapshot-version }} > .github/workflows/SNAPSHOT_VERSION | ||
echo ::set-output name=snapshot-version-changed::true | ||
else | ||
echo "Snapshot version was not changed" | ||
echo ::set-output name=snapshot-version-changed::false | ||
fi | ||
- name: Commit release snapshot update to repository (if version changed) | ||
uses: EndBug/[email protected] | ||
if: ${{ needs.read-version.outputs.snapshot-version-changed }} | ||
with: | ||
author_name: apiman-ci | ||
default_author: user_info | ||
message: "chore(ci): update SNAPSHOT_VERSION to ${{ github.event.client_payload.snapshot-version }}" | ||
add: .github/workflows --force | ||
|
||
rebuild-same-version-snapshot: | ||
name: Rebuild snapshot version when code has changed, but snapshot version *not* changed | ||
needs: build | ||
uses: apiman/apiman-docker/.github/workflows/docker-test-release.yml@master | ||
if: ${{ needs.build.outputs.snapshot-version-changed == 'false' }} | ||
secrets: inherit | ||
with: | ||
apiman-version: ${{ github.event.client_payload.snapshot-version }} | ||
push-to-repos: true | ||
snapshot: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#!/bin/bash | ||
|
||
OLD_IFS=$IFS | ||
IFS=$'\n' | ||
|
||
export DOCKER_TAGS | ||
if [[ $IS_SNAPSHOT == 'true' ]] | ||
then | ||
|
||
read -r -d '' DOCKER_TAGS <<EOF | ||
apiman/$IMAGE_NAME:$APIMAN_VERSION | ||
apiman/$IMAGE_NAME:latest | ||
EOF | ||
|
||
else | ||
|
||
read -r -d '' DOCKER_TAGS <<EOF | ||
apiman/$IMAGE_NAME:$APIMAN_VERSION | ||
apiman/$IMAGE_NAME:latest | ||
apiman/$IMAGE_NAME:latest-release | ||
apiman/$IMAGE_NAME:stable | ||
ghcr.io/apiman/$IMAGE_NAME:$APIMAN_VERSION | ||
ghcr.io/apiman/$IMAGE_NAME:latest | ||
ghcr.io/apiman/$IMAGE_NAME:latest-release | ||
ghcr.io/apiman/$IMAGE_NAME:stable | ||
EOF | ||
|
||
fi | ||
|
||
IFS=OLD_IFS | ||
echo "$DOCKER_TAGS" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!/bin/bash | ||
|
||
# Set up git user | ||
echo "Setting up default Git User" | ||
git config --global user.name "$GITHUB_ACTOR" | ||
git config --global user.email "${GITHUB_ACTOR}@users.noreply.github.com" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.