From 73a7f0bf3780929a467543d2c09b2886c26170e2 Mon Sep 17 00:00:00 2001 From: Ringo Hoffmann Date: Sun, 7 Nov 2021 14:13:52 +0100 Subject: [PATCH] add artifacts workflow --- .github/workflows/artifacts.yml | 46 +++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 .github/workflows/artifacts.yml 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