Allows orphaned release resource removal #276
Workflow file for this run
This file contains hidden or 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: Build silta cli binary and attach to test release | |
| on: | |
| push: | |
| branches: [ feature/* ] | |
| # Allows you to run this workflow manually from the Actions tab | |
| workflow_dispatch: | |
| jobs: | |
| tests-matrix: | |
| name: Tests | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| goos: [linux, darwin, windows] | |
| goarch: [amd64, arm64] | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - uses: azure/setup-helm@v3 | |
| with: | |
| version: 'v3.18.4' | |
| name: Install Helm | |
| - name: Add wunderio Helm repo | |
| run: helm repo add wunderio https://storage.googleapis.com/charts.wdr.io | |
| - name: Set up Go | |
| uses: actions/setup-go@v3 | |
| with: | |
| go-version: 1.24.4 | |
| - name: Run tests | |
| run: go test -v ./tests | |
| releases-matrix: | |
| name: Cross compile and release Go Binaries | |
| runs-on: ubuntu-latest | |
| needs: tests-matrix | |
| strategy: | |
| matrix: | |
| # Release unsigned darwin binaries | |
| goos: [linux, darwin, windows] | |
| goarch: [amd64, arm64] | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Auth to GCP | |
| uses: google-github-actions/auth@v2 | |
| with: | |
| credentials_json: ${{ secrets.GCP_SA_KEY }} | |
| - name: Set up gcloud | |
| uses: google-github-actions/setup-gcloud@v2 | |
| with: | |
| project_id: ${{ secrets.GCP_PROJECT_ID }} | |
| - name: Set output | |
| id: vars | |
| run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT | |
| - name: Build binary | |
| run: | | |
| mkdir -p dist | |
| RELEASE_TAG="test" | |
| BIN_NAME="silta-${{ matrix.goos }}-${{ matrix.goarch }}" | |
| GOOS=${{ matrix.goos }} GOARCH=${{ matrix.goarch }} CGO_ENABLED=0 \ | |
| go build -ldflags "-X github.com/wunderio/silta-cli/internal/common.Version=${{ steps.vars.outputs.sha_short }} -s -w" \ | |
| -o dist/$BIN_NAME | |
| tar -czf dist/silta-${RELEASE_TAG}-${{ matrix.goos }}-${{ matrix.goarch }}.tar.gz \ | |
| -C dist $BIN_NAME --transform="s|$BIN_NAME|silta|" | |
| - name: Upload release asset | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: "test" | |
| files: dist/silta-test-${{ matrix.goos }}-${{ matrix.goarch }}.tar.gz | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Upload to GCS | |
| run: | | |
| RELEASE_TAG="test" | |
| FILE_NAME="silta-${RELEASE_TAG}-${{ matrix.goos }}-${{ matrix.goarch }}.tar.gz" | |
| gsutil cp "dist/$FILE_NAME" \ | |
| "gs://${{ secrets.GCP_BUCKET_NAME }}/releases/${RELEASE_TAG}/$FILE_NAME" |