From f987055f3536732a624aad6d94a2af0c41cadfea Mon Sep 17 00:00:00 2001 From: Larvan2 <78135608+Larvan2@users.noreply.github.com> Date: Tue, 14 Nov 2023 23:47:36 +0800 Subject: [PATCH] ci --- .github/workflows/build.yml | 51 +++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..91bae08 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,51 @@ +name: Build + +on: + workflow_dispatch: + push: + branches: + - master + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Set up Go + uses: actions/setup-go@v4 + with: + go-version: "1.20" + check-latest: true + + - name: Cross Compile + run: | + mkdir bin + GOOS=linux GOARCH=amd64 go build -o ./bin/geo-linux-amd64 ./cmd/geo + GOOS=linux GOARCH=arm64 go build -o ./bin/geo-linux-arm64 ./cmd/geo + GOOS=linux GOARCH=arm GOARM=7 go build -o ./bin/geo-linux-armv7 ./cmd/geo + GOOS=darwin GOARCH=amd64 go build -o ./bin/geo-macos-amd64 ./cmd/geo + GOOS=darwin GOARCH=arm64 go build -o ./bin/geo-macos-arm64 ./cmd/geo + GOOS=windows GOARCH=amd64 go build -o ./bin/geo-windows-amd64.exe ./cmd/geo + GOOS=windows GOARCH=arm64 go build -o ./bin/geo-windows-arm64.exe ./cmd/geo + GOOS=windows GOARCH=arm GOARM=7 go build -o ./bin/geo-windows-armv7.exe ./cmd/geo + + - name: Delete current release assets + uses: andreaswilli/delete-release-assets-action@v3.0.0 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + tag: latest + deleteOnlyFromDrafts: false + + - name: Create and Upload Release + id: upload_release + uses: svenstaro/upload-release-action@v2 + with: + repo_token: ${{ secrets.GITHUB_TOKEN }} + release_name: "α" + tag: latest + file_glob: true + overwrite: true + file: ./bin/*