Fixed commands on README #13
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build | |
on: | |
push: | |
tags: | |
- "*.*.*" | |
branches: | |
- "main" | |
jobs: | |
Build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-go@v5 | |
with: | |
go-version: ">=1.20.0" | |
- uses: actions/setup-node@v4 | |
name: 'Setup Node' | |
with: | |
node-version: 20 | |
registry-url: https://registry.npmjs.org/ | |
- uses: pnpm/action-setup@v4 | |
name: 'Install pnpm' | |
with: | |
version: 9 | |
run_install: false | |
- name: Prepare things | |
id: prepare | |
run: | | |
mkdir artifacts | |
# Extract version from tag | |
VERSION=$(git tag --points-at HEAD | head -n1) | |
if [[ "$VERSION" != "" ]]; then | |
echo "Release $VERSION of ${{ github.sha }}" > RELEASE.txt | |
echo >> RELEASE.txt | |
fi | |
- name: Build frontend | |
run: | | |
pnpm -C frontend build | |
- name: Build for Linux amd64 | |
run: | | |
go build -o artifacts/praga-linux-amd64 cmd/praga/praga.go | |
- name: Build for Linux arm64 | |
run: | | |
GOARCH=arm64 go build -o artifacts/praga-linux-arm64 cmd/praga/praga.go | |
- name: Build for Windows amd64 | |
run: | | |
GOOS=windows GOARCH=amd64 go build -o artifacts/praga-windows-amd64.exe cmd/praga/praga.go | |
- name: Build for Windows arm64 | |
run: | | |
GOOS=windows GOARCH=arm64 go build -o artifacts/praga-windows-arm64.exe cmd/praga/praga.go | |
# TODO: macOS build | |
- name: Archive build artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: artifacts | |
path: | | |
artifacts | |
# Release tagged pushes | |
- name: Release | |
uses: softprops/action-gh-release@v2 | |
if: startsWith(github.ref, 'refs/tags/') | |
with: | |
body_path: RELEASE.txt | |
files: artifacts/* |