From b0f7ff04e3ff0c000ae7b0d7b30b2639c99ff2f4 Mon Sep 17 00:00:00 2001 From: ItsNiceCraft <74358857+ItsNiceCraft@users.noreply.github.com> Date: Sun, 7 Jan 2024 11:33:26 +0100 Subject: [PATCH] feat: add build ci workflow --- .github/workflows/build.yml | 38 +++++++++++++++++++++++++++++++++++++ 1 file changed, 38 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..cdbed96 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,38 @@ +name: Build CI + +on: + push: + branches: ["main"] + +permissions: + contents: write + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-go@v5 + with: + go-version: stable + - name: Install dependencies + run: go mod download + - uses: goreleaser/goreleaser-action@v5 + with: + distribution: goreleaser + version: latest + args: build --clean --snapshot + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Delete unused files + run: | + cd dist + rm -rf *.json *.json *.yaml *.tar.gz + - name: Get short SHA + id: short-sha + run: echo "::set-output name=sha::$(git rev-parse --short HEAD)" + - name: Upload artifact + uses: actions/upload-artifact@v4 + with: + name: wfc-server-${{ steps.short-sha.outputs.sha }} + path: ./dist/*/* \ No newline at end of file