Skip to content

Create release.yml

Create release.yml #1

Workflow file for this run

# This workflow will build a golang project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go
name: Go
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
build-linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.22'
- name: Build
run: go build -v -ldflags "-s -w" -o hasherino-linux
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: hasherino-linux
path: hasherino-linux
build-windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.22'
- name: Build
run: go build -v -ldflags "-s -w" -o hasherino-windows.exe
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: hasherino-windows
path: hasherino-windows.exe
release:
runs-on: ubuntu-latest
needs: [build-linux, build-windows]
steps:
- uses: actions/checkout@v3
- name: Download windows artifact
id: linux
uses: actions/download-artifact@v3
with:
name: 'hasherino-windows'
path: 'artifacts'
- name: Download linux artifact
id: windows
uses: actions/download-artifact@v3
with:
name: 'hasherino-linux'
path: 'artifacts'
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
token: ${{ secrets.CUSTOM_GITHUB_TOKEN }}
body_path: CHANGELOG.md
files: |
artifacts/*