-
Notifications
You must be signed in to change notification settings - Fork 204
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #71 from shfc/feat/gh-workflows
feat: add github workflows for release
- Loading branch information
Showing
1 changed file
with
55 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
name: Release | ||
|
||
on: | ||
push: | ||
tags: | ||
- "*" | ||
|
||
env: | ||
GO_VERSION: 1.17 | ||
CGO_ENABLED: 0 | ||
GO111MODULE: on | ||
|
||
jobs: | ||
build: | ||
name: Build | ||
strategy: | ||
matrix: | ||
os: [ linux, windows, darwin ] | ||
arch: [ amd64, arm64, 386 ] | ||
include: | ||
- os: windows | ||
file-extension: ".exe" | ||
exclude: | ||
- os: darwin | ||
arch: 386 | ||
runs-on: ubuntu-latest | ||
env: | ||
GOOS: ${{ matrix.os }} | ||
GOARCH: ${{ matrix.arch }} | ||
FILEEXTENSION: ${{ matrix.file-extension }} | ||
steps: | ||
- name: Checkout Git repo | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Set up Go | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version: ${{ env.GO_VERSION }} | ||
|
||
- name: Get dependencies | ||
run: | | ||
go mod download | ||
- name: Build binary | ||
run: | | ||
GOOS=${GOOS} GOARCH=${GOARCH} go build -o ./Releases/m3u8-${GOOS}-${GOARCH}${FILEEXTENSION} m3u8-downloader.go | ||
- name: Release | ||
uses: softprops/action-gh-release@v2 | ||
if: startsWith(github.ref, 'refs/tags/') | ||
with: | ||
files: | | ||
./Releases/* |