From dd28dd3936ef085d1a4f54ef476e4fd194a96e69 Mon Sep 17 00:00:00 2001 From: Netail Date: Mon, 23 Jun 2025 22:23:51 +0200 Subject: [PATCH] feat: GitHub workflows --- .github/workflows/pull-request.yml | 26 ++++++++++++++++++++++ .github/workflows/release.yml | 35 ++++++++++++++++++++++++++++++ 2 files changed, 61 insertions(+) create mode 100644 .github/workflows/pull-request.yml create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml new file mode 100644 index 0000000..b5fad17 --- /dev/null +++ b/.github/workflows/pull-request.yml @@ -0,0 +1,26 @@ +name: Pull Request + +on: + pull_request: + types: [opened, reopened, synchronize, ready_for_review, unlocked] + +jobs: + build: + name: Build + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Set up Go + uses: actions/setup-go@v4 + with: + go-version: "1.24.4" + + - name: Install dependencies + run: go get . + + - name: Build + run: go build -v ./main.go + + - name: Test + run: go test -v diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..527ffa2 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,35 @@ +name: Release + +on: + release: + types: [created] + +permissions: + contents: write + packages: write + +jobs: + build: + name: Build + runs-on: ubuntu-latest + strategy: + matrix: + # build and publish in parallel: linux/386, linux/amd64, linux/arm64, windows/386, windows/amd64, darwin/amd64, darwin/arm64 + goos: [linux, windows, darwin] + goarch: ["386", amd64, arm64] + exclude: + - goarch: "386" + goos: darwin + - goarch: arm64 + goos: windows + steps: + - uses: actions/checkout@v4 + + - name: Create Release + uses: wangyoucao577/go-release-action@v1 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + goos: ${{ matrix.goos }} + goarch: ${{ matrix.goarch }} + goversion: "1.24.4" + extra_files: LICENSE README.md