release #15
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
# This workflow runs on tags / releases. It also runs on nightly builds without | |
# publishing anything, in order to test as much of the build works as possible. | |
# | |
# We indicate whether it should publish, vs. just build, by checking whether | |
# `github.event_name == 'release'` . (An alternative would be to have an input | |
# which is passed in by the calling workflow.) | |
name: release | |
on: | |
release: | |
types: [released] | |
workflow_call: | |
workflow_dispatch: | |
jobs: | |
build-prqlc: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- os: ubuntu-latest | |
target: x86_64-unknown-linux-musl | |
- os: ubuntu-latest | |
target: aarch64-unknown-linux-musl | |
permissions: | |
contents: write | |
steps: | |
- name: 📂 Checkout code | |
uses: actions/checkout@v4 | |
- uses: ./.github/actions/build-prqlc | |
id: build-artifact | |
with: | |
target: ${{ matrix.target }} | |
profile: release | |
features: cli | |
- name: Upload release artifact | |
if: github.event_name == 'release' | |
uses: softprops/action-gh-release@v2 | |
with: | |
append_body: true | |
files: ${{ steps.build-artifact.outputs.artifact-name }} | |
- name: test the CLI works | |
# TODO: Add for Windows too (but will require unzipping rather than | |
# un-taring) | |
# | |
# Currently filtering by x86, since that's the same as those not | |
# cross-compiled. But we'll have to refine this in the future. | |
if: | |
${{ contains(matrix.target, 'x86') && matrix.target != | |
'x86_64-pc-windows-msvc' }} | |
run: | | |
# `prqlc` is an existing path at the root | |
mkdir -p temp_path | |
tar xzf ${{ steps.build-artifact.outputs.artifact-name }} -C temp_path | |
./temp_path/prqlc --help | |
build-prqlc-c: | |
# Mostly a copy/paste of `build-prqlc`. | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- os: ubuntu-latest | |
target: x86_64-unknown-linux-musl | |
- os: ubuntu-latest | |
target: aarch64-unknown-linux-musl | |
permissions: | |
contents: write | |
steps: | |
- name: 📂 Checkout code | |
uses: actions/checkout@v4 | |
- uses: ./.github/actions/build-prqlc-c | |
id: build-artifact | |
with: | |
target: ${{ matrix.target }} | |
profile: release | |
- name: Upload release artifact | |
if: github.event_name == 'release' | |
uses: softprops/action-gh-release@v2 | |
with: | |
append_body: true | |
files: ${{ steps.build-artifact.outputs.artifact-name }} | |
build-and-publish-snap: | |
runs-on: ubuntu-latest | |
steps: | |
- name: 📂 Checkout code | |
uses: actions/checkout@v4 | |
#with: | |
# fetch-depth: 0 | |
# fetch-tags: true | |
- name: Move Snap to project root directory | |
run: cp -r prqlc/packages/snap/ . | |
- name: 📦 Build Snap | |
id: build | |
uses: snapcore/action-build@v1 | |
- name: 🆙 Publish Snap | |
if: github.event_name == 'release' | |
uses: snapcore/action-publish@v1 | |
env: | |
SNAPCRAFT_STORE_CREDENTIALS: | |
${{ secrets.SNAPCRAFT_STORE_CREDENTIALS }} | |
with: | |
snap: ${{ steps.build.outputs.snap }} | |
release: edge |