Skip to content

Commit

Permalink
Updated build.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
varbhat committed Jan 18, 2022
1 parent 0b9af4b commit bda1d06
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 1 deletion.
42 changes: 42 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Build

on:
push:
tags:
- v*

jobs:
build:
if: ${{ github.owner }} == "varbhat"
runs-on: ubuntu-latest

container:
image: "ghcr.io/varbhat/void-container:glibc"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

steps:
- name: Prepare container
run: |
xbps-install -Syu || xbps-install -yu xbps
xbps-install -yu
- name: Install Packages
run: xbps-install -Sy git wget bash go nodejs github-cli
- name: Checkout repository
uses: actions/checkout@v2
- name: Build serv for Linux (amd64 and arm64) and Win (amd64)
run: |
go mod tidy
GOOS="linux" GOARCH="amd64" go build -tags netgo -trimpath --buildmode=pie -ldflags '-s -w' -o build/serv-linux-amd64
GOOS="linux" GOARCH="arm64" go build -tags netgo -trimpath --buildmode=pie -ldflags '-s -w' -o build/serv-linux-arm64
GOOS="darwin" GOARCH="amd64" go build -tags netgo -trimpath --buildmode=pie -ldflags '-s -w' -o build/serv-darwin-amd64
GOOS="darwin" GOARCH="arm64" go build -tags netgo -trimpath --buildmode=pie -ldflags '-s -w' -o build/serv-darwin-arm64
GOOS="windows" GOARCH="amd64" go build -tags netgo -trimpath --buildmode=pie -ldflags '-s -w' -o build/serv-win-amd64.exe
- name: Generate SHA256 Checksum
run: |
cd build && sha256sum -b * > checksums_sha256.txt
cd ..
- name: Publish Releases
run: |
gh config set prompt disabled
gh release create $(git tag -l | tail -n1) -t $(git tag -l | tail -n1) -p build/*
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

## Installation

You can download binary for your OS from [Releases](https://github.com/varbhat/serv/releases/latest) . Also , if you have [Go](https://golang.org/) installed , you can install `torpar` by typing this in terminal.
You can download binary for your OS from [Releases](https://github.com/varbhat/serv/releases/latest) . Also , if you have [Go](https://golang.org/) installed , you can install `serv` by typing this in terminal.

```bash
go install github.com/varbhat/serv@latest
Expand Down

0 comments on commit bda1d06

Please sign in to comment.