Build flow
This commit is contained in:
13
.github/workflows/build.yml
vendored
13
.github/workflows/build.yml
vendored
@@ -1,6 +1,9 @@
|
||||
name: Build and Release
|
||||
|
||||
on: push
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- '*'
|
||||
|
||||
jobs:
|
||||
build:
|
||||
@@ -34,15 +37,15 @@ jobs:
|
||||
- name: Compress artifacts
|
||||
run: |
|
||||
mkdir -p compressed_artifacts
|
||||
for platform in windows/amd64 linux/amd64 linux/arm64 darwin/arm64; do
|
||||
tar -czvf "compressed_artifacts/zurg-$platform-${{ github.run_number }}-${{ github.sha }}.tar.gz" -C artifacts ./zurg-$platform*
|
||||
for platform in windows-amd64.exe linux-amd64 linux-arm64 darwin-arm64; do
|
||||
zip -r "compressed_artifacts/zurg-$platform-${{ github.ref }}.zip" "artifacts/zurg-$platform"
|
||||
done
|
||||
|
||||
- name: Upload artifacts to workflow
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: compiled-binaries
|
||||
path: compressed_artifacts/*.tar.gz
|
||||
path: compressed_artifacts/*.zip
|
||||
|
||||
release:
|
||||
needs: build
|
||||
@@ -69,7 +72,7 @@ jobs:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: |
|
||||
for platform in windows/amd64 linux/amd64 linux/arm64 darwin/arm64; do
|
||||
asset_path="./compressed_artifacts/zurg-$platform-${{ github.run_number }}-${{ github.sha }}.tar.gz"
|
||||
asset_path="./compressed_artifacts/zurg-$platform-${{ github.ref }}.zip"
|
||||
if [[ -f "$asset_path" ]]; then
|
||||
echo "Uploading $asset_path"
|
||||
gh release upload ${{ github.ref }} "$asset_path" --c ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
40
.github/workflows/build.yml.bak
vendored
40
.github/workflows/build.yml.bak
vendored
@@ -1,40 +0,0 @@
|
||||
name: build
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ '**' ]
|
||||
pull_request:
|
||||
branches: [ '**' ]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
strategy:
|
||||
matrix:
|
||||
platform: [ubuntu-latest]
|
||||
go-version: [1.21.3]
|
||||
name: Build
|
||||
runs-on: ${{ matrix.platform }}
|
||||
steps:
|
||||
- name: Setup Go
|
||||
uses: actions/setup-go@v4
|
||||
with:
|
||||
go-version: ${{ matrix.go-version }}
|
||||
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
docker pull techknowlogick/xgo:latest
|
||||
go install src.techknowlogick.com/xgo@latest
|
||||
sudo apt install upx
|
||||
|
||||
- name: Build
|
||||
run: |
|
||||
bash build.sh dev
|
||||
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: zurg
|
||||
path: dist
|
||||
Reference in New Issue
Block a user