Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

chore: improve release workflow#60

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
matifali merged 8 commits intomainfrommatifali/pre-release
Jul 31, 2024
Merged
Show file tree
Hide file tree
Changes fromall 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
32 changes: 17 additions & 15 deletions.github/workflows/release.yaml
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -65,21 +65,23 @@ jobs:
gsutil -h "Cache-Control:no-cache,max-age=0" cp build/helm/${version}.tgz gs://helm.coder.com/logstream-kube
gsutil -h "Cache-Control:no-cache,max-age=0" cp build/helm/index.yaml gs://helm.coder.com/logstream-kube

- name: Create Release
uses: actions/create-release@v1
id: create_release
env:
GITHUB_TOKEN: ${{ github.token }}
with:
release_name: ${{ steps.version.outputs.version }}
tag_name: ${{ github.ref }}
- name: Create and upload release
run: |
set -euo pipefail
version=${{ steps.version.outputs.version }}

# check if release already exists and match the version
if [[ $(gh release view $version --json name -q '.name' | cat) == $version ]]; then
echo "Release $version already exists"
exit 0
fi

- name: Upload Helm Release Asset
uses: actions/upload-release-asset@v1
echo "Creating release $version"
# if version contains -rc, publish as a pre-release and don't set as latest
if [[ $version == *-rc* ]]; then
gh release create $version -t $version --generate-notes --prerelease --latest=false --verify-tag build/${version}.tgz#helm.tar.gz
else
Copy link
Member

Choose a reason for hiding this comment

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

nit: can remove else case and outdent below block due toexit 0

matifali reacted with thumbs up emoji
Copy link
MemberAuthor

Choose a reason for hiding this comment

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

I also discovered that thegh release view is interactive and ensured it could run noninteractively.

gh release create $version -t $version --generate-notes --verify-tag build/${version}.tgz#helm.tar.gz
fi
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: build/${{ steps.version.outputs.version }}.tgz
asset_name: helm.tar.gz
asset_content_type: application/gzip
9 changes: 7 additions & 2 deletionsscripts/build.sh
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -33,12 +33,17 @@ fi
# Ensure the builder is bootstrapped and ready to use
docker buildx inspect --bootstrap &>/dev/null

# Build
# Build and push the image
if [ "$CI" = "false" ]; then
docker buildx build --platform linux/"$current" -t coder-logstream-kube --load .
else
VERSION=$(../scripts/version.sh)
BASE=ghcr.io/coder/coder-logstream-kube
IMAGE=$BASE:$VERSION
docker buildx build --platform linux/amd64,linux/arm64,linux/arm/v7 -t "$IMAGE" -t $BASE:latest --push .
# if version contains "rc" skip pushing to latest
if [[ $VERSION == *"rc"* ]]; then
docker buildx build --platform linux/amd64,linux/arm64,linux/arm/v7 -t "$IMAGE" --push .
else
docker buildx build --platform linux/amd64,linux/arm64,linux/arm/v7 -t "$IMAGE" -t $BASE:latest --push .
fi
fi

[8]ページ先頭

©2009-2025 Movatter.jp