add artifacts workflow
This commit is contained in:
parent
aff231de53
commit
73a7f0bf37
46
.github/workflows/artifacts.yml
vendored
Normal file
46
.github/workflows/artifacts.yml
vendored
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
name: Build Artifacts
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
|
paths-ignore:
|
||||||
|
- "**.md"
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build_artifacts:
|
||||||
|
name: Build Artifcats
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
goos:
|
||||||
|
- linux
|
||||||
|
- windows
|
||||||
|
- darwin
|
||||||
|
goarch:
|
||||||
|
- amd64
|
||||||
|
- arm64
|
||||||
|
steps:
|
||||||
|
- name: Set up Go
|
||||||
|
uses: actions/setup-go@v1
|
||||||
|
with:
|
||||||
|
go-version: "^1.17"
|
||||||
|
- name: Check out code into the Go module directory
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
- name: Get dependencies
|
||||||
|
run: go get ./...
|
||||||
|
- name: Build Client (${{ matrix.goos }}-${{ matrix.goarch }})
|
||||||
|
env:
|
||||||
|
GOOS: ${{ matrix.goos }}
|
||||||
|
GOARCH: ${{ matrix.goarch }}
|
||||||
|
run: go build -v -o ./bin/gowebdav-${{ matrix.goos }}-${{ matrix.goarch }} ./cmd/gowebdav/main.go
|
||||||
|
- name: Rename Windows Binary
|
||||||
|
if: ${{ matrix.goos == 'windows' }}
|
||||||
|
env:
|
||||||
|
FNAME: ./bin/gowebdav-${{ matrix.goos }}-${{ matrix.goarch }}
|
||||||
|
run: mv ${{ env.FNAME }} ${{ env.FNAME }}.exe
|
||||||
|
- name: Upload Artifcats
|
||||||
|
uses: actions/upload-artifact@v2
|
||||||
|
with:
|
||||||
|
name: ${{ matrix.goos }}-${{ matrix.goarch }}
|
||||||
|
path: ./bin/
|
Loading…
Reference in New Issue
Block a user