cli-v1.1.0 #19
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on: | |
release: | |
types: | |
- published | |
name: Upload CLI Release Asset | |
jobs: | |
release-c-cli: | |
name: Upload Release C CLI | |
if: github.event_name == 'release' && startsWith(github.event.release.name, 'cli-') | |
strategy: | |
matrix: | |
os: [ubuntu-latest] # windows-latest | |
runs-on: ${{ matrix.os }} | |
env: | |
OSNAME: ${{matrix.os == 'ubuntu-latest' && 'linux' || matrix.os == 'windows-latest' && 'windows' || 'macos' }} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Set env var | |
run: echo "ZIPFILE=sqlitecloud-c-${{ github.event.release.name }}-${{ env.OSNAME }}.zip" >> $GITHUB_ENV | |
- name: Build CLI | |
run: | | |
cd C | |
make TLS_STATIC=1 cli | |
zip ${{ env.ZIPFILE }} sqlitecloud-cli | |
- name: Get release | |
id: release | |
uses: bruceadams/get-release@v1.2.3 | |
if: runner.os != 'macOS' | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Upload Release Asset | |
id: upload-release-asset | |
uses: actions/upload-release-asset@v1 | |
if: runner.os != 'macOS' | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.release.outputs.upload_url }} | |
asset_path: ./C/${{ env.ZIPFILE }} | |
asset_name: ${{ env.ZIPFILE }} | |
asset_content_type: application/zip | |
release-go-cli: | |
name: Upload Release GO CLI | |
if: github.event_name == 'release' && startsWith(github.event.release.name, 'cli-') | |
strategy: | |
matrix: | |
include: | |
- goarch: amd64 | |
goos: linux | |
- goarch: amd64 | |
goos: windows | |
- goarch: arm64 | |
goos: darwin | |
- goarch: amd64 | |
goos: darwin | |
runs-on: ubuntu-latest | |
env: | |
OSNAME: ${{matrix.goos == 'darwin' && 'macos' || matrix.goos }} | |
GOARCH: ${{ matrix.goarch }} | |
GOOS: ${{ matrix.goos }} | |
ARCHNAME: ${{ matrix.goarch == 'amd64' && 'x86-64' || matrix.goarch }} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
- name: Set env var | |
run: echo "ZIPFILE=sqlitecloud-go-${{ github.event.release.name }}-${{ env.OSNAME }}-${{ env.ARCHNAME }}.zip" >> $GITHUB_ENV | |
- name: Build CLI | |
run: | | |
cd GO/cli | |
go build -o ../sqlc | |
cd .. | |
zip ${{ env.ZIPFILE }} sqlc | |
- name: Get release | |
id: release | |
uses: bruceadams/get-release@v1.2.3 | |
if: matrix.goos != 'darwin' | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Upload Release Asset | |
id: upload-release-asset | |
uses: actions/upload-release-asset@v1 | |
if: matrix.goos != 'darwin' | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.release.outputs.upload_url }} | |
asset_path: ./GO/${{ env.ZIPFILE }} | |
asset_name: ${{ env.ZIPFILE }} | |
asset_content_type: application/zip | |
- name: Upload binary artifact | |
uses: actions/upload-artifact@v3 | |
if: matrix.goos == 'darwin' | |
with: | |
name: ${{ env.ZIPFILE }} | |
path: ./GO/${{ env.ZIPFILE }} | |
if-no-files-found: error |