-
-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Artur Troian <[email protected]>
- Loading branch information
Showing
5 changed files
with
75 additions
and
13 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,17 +27,32 @@ jobs: | |
uses: c-py/action-dotenv-to-setenv@v3 | ||
with: | ||
env-file: .env | ||
- shell: bash | ||
run: echo "RELEASE_TAG=$(make tag)" >> $GITHUB_ENV; | ||
- uses: actions/setup-go@v2 | ||
with: | ||
go-version: "${{ env.GO_VERSION }}" | ||
- name: Define and set tags | ||
shell: bash | ||
id: set_tags | ||
run: | | ||
export cross_tags="$(./scripts/image-tags.sh cross)" | ||
export cross_base_tags="$(./scripts/image-tags.sh cross-base)" | ||
cross_tags="${cross_tags//'%'/'%25'}" | ||
cross_tags="${cross_tags//$'\n'/'%0A'}" | ||
cross_tags="${cross_tags//$'\r'/'%0D'}" | ||
cross_base_tags="${cross_base_tags//'%'/'%25'}" | ||
cross_base_tags="${cross_base_tags//$'\n'/'%0A'}" | ||
cross_base_tags="${cross_base_tags//$'\r'/'%0D'}" | ||
echo "::set-output name=cross_tags::$cross_tags" | ||
echo "::set-output name=cross_base_tags::$cross_base_tags" | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v1 | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v1 | ||
- name: Install cosign | ||
uses: sigstore/[email protected] | ||
- uses: actions/setup-go@v2 | ||
with: | ||
go-version: "${{ env.GO_VERSION }}" | ||
- name: Install git-chglog | ||
run: go install github.com/git-chglog/git-chglog/cmd/git-chglog@${{ env.GIT_CHGLOG_VERSION }} | ||
- name: Build and push base images | ||
|
@@ -48,8 +63,7 @@ jobs: | |
push: true | ||
file: Dockerfile.base | ||
tags: | | ||
ghcr.io/goreleaser/goreleaser-cross-base:${{env.RELEASE_TAG}} | ||
goreleaser/goreleaser-cross-base:${{env.RELEASE_TAG}} | ||
${{ steps.set_tags.outputs.cross_base_tags }} | ||
build-args: | | ||
"GO_VERSION=${{env.GO_VERSION}}" | ||
"GORELEASER_VERSION=${{env.GORELEASER_VERSION}}" | ||
|
@@ -64,8 +78,7 @@ jobs: | |
platforms: linux/amd64,linux/arm64 | ||
push: true | ||
tags: | | ||
ghcr.io/goreleaser/goreleaser-cross:${{env.RELEASE_TAG}} | ||
goreleaser/goreleaser-cross:${{env.RELEASE_TAG}} | ||
${{ steps.set_tags.outputs.cross_tags }} | ||
build-args: | | ||
"GO_VERSION=${{env.GO_VERSION}}" | ||
"OSX_SDK=${{env.OSX_SDK}}" | ||
|
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 |
---|---|---|
|
@@ -4,3 +4,4 @@ vendor | |
.docker-creds | ||
changelog.md | ||
cosign.key | ||
.tmpenv |
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 |
---|---|---|
@@ -0,0 +1,37 @@ | ||
#!/usr/bin/env bash | ||
|
||
# in akash even minor part of the tag indicates release belongs to the MAINNET | ||
# using it as scripts simplifies debugging as well as portability | ||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)" | ||
|
||
function generate_tags { | ||
hub="goreleaser/$1" | ||
ghcr=ghcr.io/$hub | ||
|
||
tag=$(make tag) | ||
GORELEASER_VERSION=v$GORELEASER_VERSION | ||
|
||
if [[ $("${SCRIPT_DIR}"/is_prerelease.sh "$tag") == true ]]; then | ||
echo "$hub:$tag" | ||
echo "$hub:$tag.$GORELEASER_VERSION" | ||
echo "$ghcr:$tag" | ||
echo "$ghcr:$tag.$GORELEASER_VERSION" | ||
else | ||
echo "$hub:latest" | ||
echo "$hub:$tag" | ||
echo "$hub:$tag-$GORELEASER_VERSION" | ||
echo "$ghcr:latest" | ||
echo "$ghcr:$tag-$GORELEASER_VERSION" | ||
fi | ||
|
||
exit 0 | ||
} | ||
|
||
case $1 in | ||
cross-base) | ||
generate_tags goreleaser-cross-base | ||
;; | ||
cross) | ||
generate_tags goreleaser-cross | ||
;; | ||
esac |
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,12 @@ | ||
#!/usr/bin/env bash | ||
|
||
# in akash even minor part of the tag indicates release belongs to the MAINNET | ||
# using it as scripts simplifies debugging as well as portability | ||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)" | ||
|
||
if [[ $# -ne 1 ]]; then | ||
echo "illegal number of parameters" | ||
exit 1 | ||
fi | ||
|
||
[[ -n $("${SCRIPT_DIR}"/semver.sh get prerel "$1") ]] && echo true || echo false |