Skip to content

Commit

Permalink
Merge pull request #147 from srl-labs/chore/fix-clabverter-binary-ver…
Browse files Browse the repository at this point in the history
…sion-on-release

feat: fixes clabverter binary on release hopefully :p
  • Loading branch information
carlmontanari authored May 13, 2024
2 parents 4a26818 + 6199f08 commit d505fe6
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 19 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,14 @@ jobs:
- name: install devspace
run: |
curl -L -o devspace \
"https://github.com/loft-sh/devspace/releases/download/${{ env.DEVSPACE_VERSION}}/devspace-linux-amd64" &&
"https://github.com/loft-sh/devspace/releases/download/${{ env.DEVSPACE_VERSION }}/devspace-linux-amd64" &&
install -c -m 0755 devspace /usr/local/bin
working-directory: /tmp

- name: install helm
run: |
curl -L -o helm.tar.gz \
"https://get.helm.sh/helm-${{ env.HELM_VERSION}}-linux-amd64.tar.gz"
"https://get.helm.sh/helm-${{ env.HELM_VERSION }}-linux-amd64.tar.gz"
tar -zxvf helm.tar.gz
mv linux-amd64/helm /usr/local/bin/helm
working-directory: /tmp
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/custom-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
- name: install devspace
run: |
curl -L -o devspace \
"https://github.com/loft-sh/devspace/releases/download/${{ env.DEVSPACE_VERSION}}/devspace-linux-amd64" &&
"https://github.com/loft-sh/devspace/releases/download/${{ env.DEVSPACE_VERSION }}/devspace-linux-amd64" &&
install -c -m 0755 devspace /usr/local/bin
working-directory: /tmp

Expand Down
34 changes: 18 additions & 16 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,24 @@ jobs:
echo "HELM_VERSION=$HELM_VERSION" >> "$GITHUB_ENV"
echo "GORELEASER_VERSION=$GORELEASER_VERSION" >> "$GITHUB_ENV"
- name: set release version var
run: |
RELEASE_TAG=${{ github.ref_name }}
RELEASE_VERSION=${RELEASE_TAG#v}
echo "RELEASE_VERSION=$RELEASE_VERSION" >> "$GITHUB_ENV"
- name: install devspace
run: |
curl -L -o devspace \
"https://github.com/loft-sh/devspace/releases/download/${{ env.DEVSPACE_VERSION}}/devspace-linux-amd64" &&
"https://github.com/loft-sh/devspace/releases/download/${{ env.DEVSPACE_VERSION }}/devspace-linux-amd64" &&
install -c -m 0755 devspace /usr/local/bin
working-directory: /tmp

- name: install helm
run: |
curl -L -o helm.tar.gz \
"https://get.helm.sh/helm-${{ env.HELM_VERSION}}-linux-amd64.tar.gz"
"https://get.helm.sh/helm-${{ env.HELM_VERSION }}-linux-amd64.tar.gz"
tar -zxvf helm.tar.gz
mv linux-amd64/helm /usr/local/bin/helm
working-directory: /tmp
Expand All @@ -69,6 +76,7 @@ jobs:
args: release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
RELEASE_VERSION: ${{ env.RELEASE_VERSION }}

# simply use gh cli to upload since we dont actually want an action that makes the release
# for us, just wanna upload assets
Expand All @@ -85,23 +93,17 @@ jobs:
shell: bash

- name: build and push images
run: |
RELEASE_TAG=${{ github.ref_name }}
RELEASE_VERSION=${RELEASE_TAG#v}
devspace run build --profile release --var RELEASE_VERSION=$RELEASE_VERSION
run: |
devspace run build --profile release --var RELEASE_VERSION=${{ env.RELEASE_VERSION }}
- name: package and push charts
run: |
RELEASE_TAG=${{ github.ref_name }}
RELEASE_VERSION=${RELEASE_TAG#v}
run: |
helm registry login -u ${{ github.actor }} -p ${{ secrets.GITHUB_TOKEN }} ghcr.io
make set-chart-versions $RELEASE_VERSION
make set-chart-versions ${{ env.RELEASE_VERSION }}
helm package charts/clicker --version $RELEASE_VERSION
helm push clicker-$RELEASE_VERSION.tgz oci://ghcr.io/srl-labs/clabernetes
helm package charts/clicker --version ${{ env.RELEASE_VERSION }}
helm push clicker-${{ env.RELEASE_VERSION }}.tgz oci://ghcr.io/srl-labs/clabernetes
helm package charts/clabernetes --version $RELEASE_VERSION
helm push clabernetes-$RELEASE_VERSION.tgz oci://ghcr.io/srl-labs/clabernetes
helm package charts/clabernetes --version ${{ env.RELEASE_VERSION }}
helm push clabernetes-${{ env.RELEASE_VERSION }}.tgz oci://ghcr.io/srl-labs/clabernetes
6 changes: 6 additions & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ builds:
main: ./cmd/clabverter/main.go
env:
- CGO_ENABLED=0
- VERSION={{ .Env.RELEASE_VERSION }}
ldflags:
- -s -w -X github.com/srl-labs/clabernetes/constants.Version={{ .Env.VERSION }}
flags:
- -trimpath
- -a
goos:
- linux
- darwin
Expand Down

0 comments on commit d505fe6

Please sign in to comment.