Skip to content

GA: fix SALAMI_VERSION and remove event type #2

GA: fix SALAMI_VERSION and remove event type

GA: fix SALAMI_VERSION and remove event type #2

name: Create GH release
on:
push:
tags:
- "*"
permissions:
contents: write
jobs:
build:
name: Build for ${{ matrix.goos }} ${{ matrix.goarch }}
runs-on: ubuntu-latest
strategy:
matrix:
include:
- goos: darwin
goarch: amd64
- goos: darwin
goarch: arm64
- goos: linux
goarch: amd64
- goos: linux
goarch: arm64
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: "1.21.2"
- name: Build binary
run: GOOS=${{ matrix.goos }} GOARCH=${{ matrix.goarch }} go build -o salami-${{ matrix.goos }}-${{ matrix.goarch }}
working-directory: ./cli
- name: Upload binary artifact
uses: actions/upload-artifact@v3
with:
name: salami-${{ matrix.goos }}-${{ matrix.goarch }}
path: cli/salami-${{ matrix.goos }}-${{ matrix.goarch }}
if-no-files-found: error
create-release:
name: Create draft release
needs: build
runs-on: ubuntu-latest
steps:
- name: Download binary artifacts
uses: actions/download-artifact@v3
- name: Create release
uses: softprops/action-gh-release@v1
with:
draft: true
prerelease: ${{ contains(github.ref, '-rc') }}
fail_on_unmatched_files: true
files: |
salami-darwin-amd64/salami-darwin-amd64
salami-darwin-arm64/salami-darwin-arm64
salami-linux-amd64/salami-linux-amd64
salami-linux-arm64/salami-linux-arm64