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