Skip to content

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Jul 31, 2024
Merged
Show file tree
Hide file tree
Changes from 4 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
24 changes: 7 additions & 17 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,21 +65,11 @@ 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: Upload Helm Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
- name: Create and upload release
uses: softprops/action-gh-release@v2
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
token: ${{ github.token }}
tag_name: ${{ github.ref_name }}
files: build/${{ steps.version.outputs.version }}.tgz
prerelease: ${{ contains(github.ref, 'rc') }}
generate_release_notes: true
7 changes: 6 additions & 1 deletion scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,10 @@ 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