release #49
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
name: release | |
on: | |
release: | |
types: [released] | |
workflow_call: | |
inputs: | |
dry-run: | |
description: "Whether to do a dry run" | |
default: true | |
type: boolean | |
workflow_dispatch: | |
inputs: | |
dry-run: | |
description: "Whether to do a dry run" | |
required: true | |
default: true | |
type: boolean | |
jobs: | |
brew-dispatcher: | |
name: Release on homebrew-prql | |
runs-on: ubuntu-latest | |
if: github.ref_type == 'tag' && !inputs.dry-run | |
steps: | |
- uses: actions/github-script@v6 | |
with: | |
github-token: ${{ secrets.PRQL_BOT_GITHUB_TOKEN }} | |
script: | | |
await github.rest.actions.createWorkflowDispatch({ | |
owner: 'prql', | |
repo: 'homebrew-prql', | |
workflow_id: 'update.yaml', | |
ref: 'main', | |
inputs: { | |
version: '${{ github.ref }}', | |
URL: 'https://github.com/PRQL/prql/archive/${{ github.ref }}.tar.gz' | |
} | |
}) | |
build-prqlc: | |
runs-on: ${{ matrix.os }} | |
if: ${{ !inputs.dry-run }} | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- os: ubuntu-latest | |
target: x86_64-unknown-linux-musl | |
- os: ubuntu-latest | |
target: aarch64-unknown-linux-musl | |
- os: macos-latest | |
target: x86_64-apple-darwin | |
- os: macos-latest | |
target: aarch64-apple-darwin | |
- os: windows-latest | |
target: x86_64-pc-windows-msvc | |
steps: | |
- name: 📂 Checkout code | |
uses: actions/checkout@v3 | |
- uses: ./.github/actions/build-prqlc | |
id: build-artifact | |
with: | |
target: ${{ matrix.target }} | |
profile: release | |
- name: Upload release artifact | |
if: github.ref_type == 'tag' && !inputs.dry-run | |
uses: softprops/action-gh-release@v1 | |
with: | |
append_body: true | |
files: ${{ steps.build-artifact.outputs.artifact-name }} | |
winget-release: | |
runs-on: ubuntu-latest | |
needs: build-prqlc | |
if: github.ref_type == 'tag' && !inputs.dry-run | |
steps: | |
- name: publish | |
uses: vedantmgoyal2009/winget-releaser@v2 | |
with: | |
identifier: PRQL.prqlc | |
version: ${{ github.ref }} | |
installers-regex: '^prqlc-.*-windows-.*\.zip$' | |
token: ${{ secrets.PRQL_BOT_GITHUB_TOKEN }} | |
fork-user: prql-bot | |
build-deb-package: | |
# TODO: currently this doesn't publish it as an artifact; would be a welcome contribution | |
# to add that (and eventually as a release asset) | |
runs-on: ubuntu-latest | |
if: ${{ !inputs.dry-run }} | |
steps: | |
- name: 📂 Checkout code | |
uses: actions/checkout@v3 | |
- name: 👷 Build prql-compiler | |
run: cargo build --release | |
- name: Copy files into .deb package | |
run: | | |
mkdir -p .debpkg/usr/bin | |
cp target/release/prqlc .debpkg/usr/bin/prqlc | |
chmod +x .debpkg/usr/bin/prqlc | |
- name: 📦 Build .deb package | |
uses: jiro4989/build-deb-action@v3 | |
with: | |
package: prqlc | |
package_root: .debpkg | |
maintainer: The PRQL Project | |
version: ${{ github.ref_type == 'tag' && github.ref_name || 0 }} | |
desc: > | |
prqlc is the CLI for the PRQL compiler. It compiles PRQL to SQL, and | |
offers various diagnostics. | |
PRQL is a modern language for transforming data — a simple, | |
powerful, pipelined SQL replacement. | |
build-rpm-package: | |
# TODO: This doesn't publish the rpm yet, that would be a welcome follow-up (even as a CI artifact) | |
runs-on: ubuntu-latest | |
if: ${{ !inputs.dry-run }} | |
steps: | |
- name: 📂 Checkout code | |
uses: actions/checkout@v3 | |
- name: 👷 Build prqlc | |
run: cargo build --bin prqlc --release | |
- name: Copy files into .rpm package | |
run: | | |
mkdir -p .rpmpkg/usr/bin | |
cp target/release/prqlc .rpmpkg/usr/bin/prqlc | |
chmod +x .rpmpkg/usr/bin/prqlc | |
- name: 📦 Build .rpm package | |
uses: jiro4989/build-rpm-action@v2 | |
with: | |
summary: CLI for PRQL, a modern language for transforming data | |
package: prqlc | |
package_root: .rpmpkg | |
maintainer: The PRQL Project | |
vendor: The PRQL Project | |
version: ${{ github.ref_type == 'tag' && github.ref_name || 0 }} | |
desc: > | |
prqlc is the CLI for the PRQL compiler. It compiles PRQL to SQL, and | |
offers various diagnostics. | |
PRQL is a modern language for transforming data — a simple, | |
powerful, pipelined SQL replacement. | |
license: Apache-2.0 | |
build-and-publish-snap: | |
runs-on: ubuntu-latest | |
if: ${{ !inputs.dry-run }} | |
steps: | |
- name: 📂 Checkout code | |
uses: actions/checkout@v3 | |
- name: Move Snap to project root directory | |
run: cp -r packages/snap/ . | |
- name: 📦 Build Snap | |
id: build | |
uses: snapcore/action-build@v1 | |
- name: 🆙 Publish Snap | |
if: github.ref_type == 'tag' && !inputs.dry-run | |
uses: snapcore/action-publish@v1 | |
env: | |
SNAPCRAFT_STORE_CREDENTIALS: | |
${{ secrets.SNAPCRAFT_STORE_CREDENTIALS }} | |
with: | |
snap: ${{ steps.build.outputs.snap }} | |
release: edge | |
build-python-wheels: | |
runs-on: ${{ matrix.os }} | |
if: ${{ !inputs.dry-run }} | |
strategy: | |
fail-fast: true | |
matrix: | |
os: [macos-latest, windows-latest] | |
include: | |
- os: ubuntu-latest | |
target: x86_64 | |
- os: ubuntu-latest | |
target: aarch64 | |
- os: ubuntu-latest | |
target: source | |
steps: | |
- name: 📂 Checkout code | |
uses: actions/checkout@v3 | |
- uses: ./.github/actions/build-prql-python | |
with: | |
target: ${{ matrix.target }} | |
publish-prql-python: | |
runs-on: ubuntu-latest | |
needs: [build-python-wheels] | |
if: github.ref_type == 'tag' && !inputs.dry-run | |
steps: | |
- uses: actions/download-artifact@v3 | |
with: | |
name: wheels | |
- name: Publish to PyPI | |
uses: messense/maturin-action@v1 | |
env: | |
MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }} | |
with: | |
command: upload | |
args: --skip-existing * | |
publish-prql-js: | |
runs-on: ubuntu-latest | |
steps: | |
- name: 📂 Checkout code | |
uses: actions/checkout@v3 | |
- uses: baptiste0928/cargo-install@v2 | |
with: | |
crate: wasm-pack | |
- name: Setup Node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: "18.x" | |
registry-url: "https://registry.npmjs.org" | |
- run: | |
npm publish ${{ (github.ref_type != 'tag' || inputs.dry-run) && | |
'--dry-run' || '' }} | |
working-directory: bindings/prql-js/ | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
publish-to-cargo: | |
runs-on: ubuntu-latest | |
steps: | |
- name: 📂 Checkout code | |
uses: actions/checkout@v3 | |
- uses: baptiste0928/cargo-install@v2 | |
with: | |
crate: cargo-release | |
# Currently, we can only check prql-ast which is not dependent other local crates with --dry-run. | |
# https://github.com/crate-ci/cargo-release/issues/691 | |
# --no-verify is required to prevent build. | |
- run: | |
cargo release publish --no-confirm ${{ github.ref_type == 'tag' && | |
!inputs.dry-run && '--execute' || '--no-verify --package prql-ast'}} | |
env: | |
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} | |
# Requires another pass: https://github.com/PRQL/prql/issues/850 | |
# publish-prql-java: | |
# runs-on: ubuntu-latest | |
# steps: | |
# - name: Checkout code | |
# uses: actions/checkout@v3 | |
# - name: Install Java and Maven | |
# uses: actions/setup-java@v3 | |
# with: | |
# java-version: 8 | |
# - name: Release Maven package | |
# uses: samuelmeuli/action-maven-publish@v1 | |
# with: | |
# gpg_private_key: ${{ secrets.gpg_private_key }} | |
# gpg_passphrase: ${{ secrets.gpg_passphrase }} | |
# nexus_username: ${{ secrets.nexus_username }} | |
# nexus_password: ${{ secrets.nexus_password }} | |
# directory: prql-java/java/ | |
push-web-branch: | |
runs-on: ubuntu-latest | |
if: github.ref_type == 'tag' && !inputs.dry-run | |
steps: | |
- name: 📂 Checkout code | |
uses: actions/checkout@v3 | |
- run: git push origin HEAD:web --force | |
push-devcontainer-base-image: | |
if: github.ref_type == 'tag' && !inputs.dry-run | |
uses: ./.github/workflows/build-devcontainer.yaml |