Skip to content

Commit

Permalink
Testing new release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
kenshaw committed Oct 27, 2023
1 parent 8a3dba6 commit d1bc735
Showing 1 changed file with 73 additions and 109 deletions.
182 changes: 73 additions & 109 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,146 +1,110 @@
name: Release
on:
push:
tags: 'v*'
on: push
# push:
# tags: 'v*'
env:
GO_VERSION: stable

jobs:
build_for_linux:
matrix:
arch: [amd64, arm, arm64]
name: Build for Linux
runs-on: ubuntu-latest
steps:
- name: Install build dependencies
run: |
sudo apt-get -qq update
sudo apt-get install -y --no-install-recommends \
sudo apt-get install -y \
build-essential \
libicu-dev \
unixodbc \
unixodbc-dev \
upx
qemu-user-static \
gcc-arm-linux-gnueabihf \
gcc-aarch64-linux-gnu \
libstdc++6-armhf-cross \
libstdc++6-arm64-cross \
libc6-dev-armhf-cross \
libc6-dev-arm64-cross \
file
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: ${{ env.GO_VERSION }}
- name: Build amd64
env:
CGO_ENABLED: 1
GOOS: linux
GOARCH: amd64
run: ./build-release.sh -r
- name: Build amd64 (static)
env:
CGO_ENABLED: 1
GOOS: linux
GOARCH: amd64
run: ./build-release.sh -r -s
- name: Archive artifacts
uses: actions/upload-artifact@v3
with:
name: dist-linux
path: build/linux/*/*/usql*.tar.bz2

build_for_macos_amd64:
name: Build for MacOS (amd64)
runs-on: macos-latest
steps:
- name: Install build dependencies
run: brew install coreutils
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: ${{ env.GO_VERSION }}
- name: Build amd64
env:
CGO_ENABLED: 1
GOOS: darwin
GOARCH: amd64
run: ./build-release.sh -r -N
- name: Archive artifacts
uses: actions/upload-artifact@v3
with:
name: dist-darwin-amd64
path: build/darwin/*/*/usql*.tar.bz2
- name: Build ${{ matrix.arch }}
run: ./build-release.sh -r -a ${{ matrix.arch }}
- name: Build ${{ matrix.arch }} (static)
run: ./build-release.sh -r -a ${{ matrix.arch }} -s

# build_for_macos_arm64:
# name: Build for MacOS (arm64)
# - name: Archive artifacts
# uses: actions/upload-artifact@v3
# with:
# name: dist-linux
# path: build/linux/*/*/usql*.tar.bz2
#
# build_for_macos:
# name: Build for MacOS (amd64)
# runs-on: macos-latest
# steps:
# - name: Install build dependencies
# run: brew install coreutils
# - name: Checkout
# uses: actions/checkout@v3
# with:
# fetch-depth: 0
# - name: Setup Go
# uses: actions/setup-go@v4
# with:
# go-version: ${{ env.GO_VERSION }}
# - name: Build arm64
# - name: Build amd64
# env:
# CGO_ENABLED: 1
# GOOS: darwin
# GOARCH: arm64
# run: ./build-release.sh -r -n -N
# GOARCH: amd64
# run: ./build-release.sh -r
# - name: Archive artifacts
# uses: actions/upload-artifact@v3
# with:
# name: dist-darwin-arm64
# name: dist-darwin-amd64
# path: build/darwin/*/*/usql*.tar.bz2
#
# build_for_windows:
# name: Build for Windows
# runs-on: windows-latest
# steps:
# - name: Install build dependencies
# run: choco install upx zip
# - name: Checkout
# uses: actions/checkout@v3
# - name: Setup Go
# uses: actions/setup-go@v4
# with:
# go-version: ${{ env.GO_VERSION }}
# - name: Build amd64
# shell: bash
# env:
# GOOS: windows
# GOARCH: amd64
# run: ./build-release.sh -r
# - name: Archive artifacts
# uses: actions/upload-artifact@v3
# with:
# name: dist-windows
# path: build/windows/*/*/usql*.zip

build_for_windows:
name: Build for Windows
runs-on: windows-latest
steps:
- name: Install build dependencies
run: choco install upx zip
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: ${{ env.GO_VERSION }}
- name: Build amd64
shell: bash
env:
CGO_ENABLED: 1
GOOS: windows
GOARCH: amd64
run: ./build-release.sh -r
- name: Archive artifacts
uses: actions/upload-artifact@v3
with:
name: dist-windows
path: build/windows/*/*/usql*.zip

release:
name: Draft Release
needs:
- build_for_linux
- build_for_macos_amd64
# - build_for_macos_arm64
- build_for_windows
runs-on: ubuntu-latest
steps:
- name: Download artifacts
uses: actions/download-artifact@v3
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
name: usql ${{ github.ref_name }}
token: ${{ secrets.GITHUB_TOKEN }}
draft: true
generate_release_notes: true
files: dist-*/*/*/usql*.*
# release:
# name: Draft Release
# needs:
# - build_for_linux
# - build_for_macos
# - build_for_windows
# runs-on: ubuntu-latest
# steps:
# - name: Download artifacts
# uses: actions/download-artifact@v3
# - name: Release
# uses: softprops/action-gh-release@v1
# if: startsWith(github.ref, 'refs/tags/')
# with:
# name: usql ${{ github.ref_name }}
# token: ${{ secrets.GITHUB_TOKEN }}
# draft: true
# generate_release_notes: true
# files: dist-*/*/*/usql*.*

0 comments on commit d1bc735

Please sign in to comment.