Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GitHub Actions pipeline #4

Merged
merged 2 commits into from
Jan 16, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
76 changes: 76 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
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
with:
fetch-depth: 0

- 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