v0.1.1 #37
Workflow file for this run
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
--- | |
name: release | |
on: | |
release: | |
types: | |
- created | |
jobs: | |
lint: | |
uses: ./.github/workflows/lint.yaml | |
test: | |
uses: ./.github/workflows/test.yaml | |
release: | |
needs: | |
- lint | |
- test | |
runs-on: ubuntu-latest | |
steps: | |
- name: checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 1 | |
- name: load env vars for workflow run | |
run: | | |
source .github/vars.env | |
echo "GO_VERSION=$GO_VERSION" >> "$GITHUB_ENV" | |
echo "DEVSPACE_VERSION=$DEVSPACE_VERSION" >> "$GITHUB_ENV" | |
echo "GCI_VERSION=$GCI_VERSION" >> "$GITHUB_ENV" | |
echo "GOFUMPT_VERSION=$GOFUMPT_VERSION" >> "$GITHUB_ENV" | |
echo "GOLANGCI_LINT_VERSION=$GOLANGCI_LINT_VERSION" >> "$GITHUB_ENV" | |
echo "GOLINES_VERSION=$GOLINES_VERSION" >> "$GITHUB_ENV" | |
echo "GOTESTSUM_VERSION=$GOTESTSUM_VERSION" >> "$GITHUB_ENV" | |
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" && | |
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" | |
tar -zxvf helm.tar.gz | |
mv linux-amd64/helm /usr/local/bin/helm | |
working-directory: /tmp | |
- name: login to ghcr | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
# note: we run goreleaser before any helm packaging since helm updates the chart.yaml files | |
# w/ the release tag/version which upsets goreleaser (and we dont want to .gitignore the chart | |
# manifest obviously) | |
- name: run goreleaser to build clabverter/checksums | |
uses: goreleaser/goreleaser-action@v5 | |
with: | |
version: ${{ env.GORELEASER_VERSION }} | |
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 | |
- name: upload clabverter binaries (and checksums) to the release | |
run: | | |
cd .dist | |
gh release upload ${{ github.ref_name }} checksums.txt | |
for filename in *.tar.gz; do | |
[ -e "$filename" ] || continue | |
gh release upload ${{ github.ref_name }} "$filename" | |
done | |
env: | |
GITHUB_TOKEN: ${{ github.TOKEN }} | |
shell: bash | |
- name: build and push images | |
run: | | |
devspace run build --profile release --var RELEASE_VERSION=${{ env.RELEASE_VERSION }} | |
- name: package and push charts | |
run: | | |
helm registry login -u ${{ github.actor }} -p ${{ secrets.GITHUB_TOKEN }} ghcr.io | |
make set-chart-versions ${{ env.RELEASE_VERSION }} | |
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 ${{ env.RELEASE_VERSION }} | |
helm push clabernetes-${{ env.RELEASE_VERSION }}.tgz oci://ghcr.io/srl-labs/clabernetes |