Skip to content

GA: hardcode files

GA: hardcode files #4

Workflow file for this run

name: Create release
on:
push:
tags:
- "*"
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: Prepare list of files
id: prepare-files
run: |
FILES="salami-darwin-amd64
salami-darwin-arm64
salami-linux-amd64
salami-linux-arm64"
echo "files={$FILES}" >> $GITHUB_OUTPUT
- name: Create release
uses: softprops/action-gh-release@v1
with:
draft: true
prerelease: ${{ contains(github.ref, '-rc') }}
fail_on_unmatched_files: true
files: ${{ steps.prepare-files.outputs.files }}