From 458317e193abcfac2fe8e042637d87cfff4d69e3 Mon Sep 17 00:00:00 2001 From: William Bell Date: Tue, 8 Aug 2023 21:12:48 +0100 Subject: [PATCH] add build_release --- .github/workflows/build_releases.yml | 45 ++++++++++++++++++++++++++++ .github/workflows/go.yml | 10 +++++-- 2 files changed, 52 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/build_releases.yml diff --git a/.github/workflows/build_releases.yml b/.github/workflows/build_releases.yml new file mode 100644 index 0000000..6723548 --- /dev/null +++ b/.github/workflows/build_releases.yml @@ -0,0 +1,45 @@ +name: Build and Release Go Binary + +on: + release: + types: + - created + +jobs: + build: + name: Build and Release + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Set up Go + uses: actions/setup-go@v2 + with: + go-version: 1.20 # Use your desired Go version + + - name: Build Go project + run: go build -o argon ./src + + - name: Create release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ github.ref }} + release_name: Release ${{ github.ref }} + draft: false + prerelease: false + + - name: Upload binary to release + id: upload-release-asset + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: ./argon + asset_name: argon + asset_content_type: application/octet-stream diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 0065213..6bee645 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -16,13 +16,17 @@ jobs: steps: - uses: actions/checkout@v3 + - name: Install or Update CA Certificates + run: | + apt update + apt install -y --reinstall ca-certificates + - name: Set up Go uses: actions/setup-go@v4 with: go-version: '1.20' - - name: Build - run: go build -v ./... + run: ./build - name: Test - run: go test -v ./... + run: go test -v ./src