Skip to content

Merge pull request #7 from salemove/add-contributing-file #21

Merge pull request #7 from salemove/add-contributing-file

Merge pull request #7 from salemove/add-contributing-file #21

name: Release on master build
on:
push:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.18
- name: Create releases directory
run: mkdir releases
- name: Build for Linux (amd64)
run: go build -o ./releases/regexp_utility-$GOOS-$GOARCH regexp_utility.go
env:
GOOS: linux
GOARCH: amd64
- name: Build for Intel based Macs (amd64)
run: go build -o ./releases/regexp_utility-$GOOS-$GOARCH regexp_utility.go
env:
GOOS: darwin
GOARCH: amd64
- name: Build for Apple Silicon based Macs (arm64)
run: go build -o ./releases/regexp_utility-$GOOS-$GOARCH regexp_utility.go
env:
GOOS: darwin
GOARCH: arm64
- name: Generate release tag
id: gen_tag
run: |
SHORT_REV=$(git rev-parse --short "$GITHUB_SHA")
echo "::set-output name=release_tag::release-$SHORT_REV"
- name: Push new tag
run: |
git tag ${{ steps.gen_tag.outputs.release_tag }}
git push origin master ${{ steps.gen_tag.outputs.release_tag }}
- name: Create GitHub release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ steps.gen_tag.outputs.release_tag }}
generate_release_notes: true
files: |
releases/regexp_utility-linux-amd64
releases/regexp_utility-darwin-amd64
releases/regexp_utility-darwin-arm64