Skip to content

fix(gha): fix inexistant version #41

fix(gha): fix inexistant version

fix(gha): fix inexistant version #41

Workflow file for this run

name: CI/CD Pipeline
on:
push:
paths:
- '**.go'
pull_request:
paths:
- '**.go'
- '.github/workflows/**'
release:
types: [created]
jobs:
build:
name: Build and Test
runs-on: ubuntu-latest
strategy:
matrix:
goos: [linux, darwin, windows]
goarch: [amd64, arm64]
steps:
- name: Checkout code
uses: actions/checkout@v3
# TODO: Move this to a separate re-usable action
- name: Cache Skaffold
id: cache-skaffold
uses: actions/cache@v4
with:
path: |
/usr/local/bin/skaffold
key: skaffold-${{ runner.os }}-${{ hashFiles('**/skaffold.yaml') }}
- name: Install Skaffold
if: steps.cache-skaffold.outputs.cache-hit != 'true'
run: |
curl -Lo skaffold https://storage.googleapis.com/skaffold/releases/latest/skaffold-linux-amd64
chmod +x skaffold
sudo mv skaffold /usr/local/bin
- name: Set up Go
uses: actions/setup-go@v5.0.2
with:
go-version: '1.21' # Specify your Go version
- name: Build binary
run: |
mkdir -p dist
GOOS=${{ matrix.goos }} GOARCH=${{ matrix.goarch }} go build -o dist/kickstart-${{ matrix.goos }}-${{ matrix.goarch }} main.go
- name: Run tests
run: make test
- name: Upload artifact (only for release)
if: github.event_name == 'release'
uses: actions/upload-artifact@v4.3.6
with:
name: kickstart-${{ matrix.goos }}-${{ matrix.goarch }}
path: dist/kickstart-${{ matrix.goos }}-${{ matrix.goarch }}
release:
name: Create GitHub Release
needs: build
runs-on: ubuntu-latest
if: github.event_name == 'release'
steps:
- name: Download artifacts
uses: actions/download-artifact@v4.1.8
with:
path: dist
- name: Create GitHub Release
uses: softprops/action-gh-release@v2.0.8
with:
files: dist/*
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}