diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..573c54f --- /dev/null +++ b/.github/workflows/release.yml @@ -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/* \ No newline at end of file