Skip to content

Commit

Permalink
Merge pull request #71 from shfc/feat/gh-workflows
Browse files Browse the repository at this point in the history
feat: add github workflows for release
  • Loading branch information
llychao authored Aug 5, 2024
2 parents 50f38ac + 3fc8d74 commit a573a6a
Showing 1 changed file with 55 additions and 0 deletions.
55 changes: 55 additions & 0 deletions .github/workflows/release.yml
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/*

0 comments on commit a573a6a

Please sign in to comment.