From d1bc73563785617a55c36439cb0a32e462ac4888 Mon Sep 17 00:00:00 2001 From: Kenneth Shaw Date: Fri, 27 Oct 2023 17:29:06 +0700 Subject: [PATCH] Testing new release workflow --- .github/workflows/release.yml | 182 ++++++++++++++-------------------- 1 file changed, 73 insertions(+), 109 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6922b678842..a935d3532da 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -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*.*