From f5425cfba1941311f62a6b89d59929807acee4a7 Mon Sep 17 00:00:00 2001 From: Artsiom Date: Fri, 27 Dec 2024 00:10:04 +0100 Subject: [PATCH 1/2] actions test --- .github/workflows/build.yml | 74 +++++++++++++++++++++++++++++++++++++ 1 file changed, 74 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..158906d --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,74 @@ +name: Build and Release + +on: + push: + branches: [ "main", "master" ] + tags: [ "v*" ] + pull_request: + branches: [ "main", "master" ] + +jobs: + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version: '1.21' + cache: true + + - name: Run tests + run: go test ./... + + build: + needs: test + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Set up Go + uses: actions/setup-go@v4 + with: + go-version: '1.21' + cache: true + + - name: Build binaries + run: make all + + - name: Upload artifacts + uses: actions/upload-artifact@v4 + with: + name: binaries + path: build/* + retention-days: 7 + + release: + needs: build + runs-on: ubuntu-latest + if: startsWith(github.ref, 'refs/tags/v') + + steps: + - uses: actions/checkout@v4 + + - name: Download artifacts + uses: actions/download-artifact@v4 + with: + name: binaries + path: build + + - name: Create Release + uses: softprops/action-gh-release@v2 + with: + files: | + build/wg-fake.linux-amd64 + build/wg-fake.linux-386 + build/wg-fake.linux-arm + build/wg-fake.linux-arm64 + build/wg-fake.darwin-amd64 + build/wg-fake.darwin-arm64 + build/wg-fake.windows-amd64.exe + build/wg-fake.windows-386.exe + build/wg-fake.windows-arm.exe + generate_release_notes: true \ No newline at end of file From d4417e9dfcd64a65ae4cd45b00407ffc9bf178b5 Mon Sep 17 00:00:00 2001 From: Artsiom Date: Fri, 27 Dec 2024 00:12:31 +0100 Subject: [PATCH 2/2] fetch-depth: 0 --- .github/workflows/build.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 158906d..f760cc6 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -27,6 +27,8 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 + with: + fetch-depth: 0 - name: Set up Go uses: actions/setup-go@v4