diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml new file mode 100644 index 0000000..77499a3 --- /dev/null +++ b/.github/workflows/go.yml @@ -0,0 +1,40 @@ +name: Go + +on: + push: + branches: [ "master" ] + pull_request: + branches: [ "master" ] + release: + types: [created] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Set up Go + uses: actions/setup-go@v4 + with: + go-version: '1.20' + + - name: Install dependencies + run: | + cd v2 + go mod tidy + + - name: Build + run: | + cd v2 + go build -o cook ./cmd/cook + + - name: Create Release + if: startsWith(github.ref, 'refs/tags/') + id: create_release + uses: softprops/action-gh-release@v1 + with: + tag: ${{ github.ref }} + files: v2/cook + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}