Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

build: Packageprqlc as Snap #1881

Merged
merged 15 commits into from
Feb 21, 2023
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions .github/workflows/publish-snap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: publish-snap
on:
release:
types: [published]

jobs:
publish-snap:
runs-on: ubuntu-latest

# Skip running workflow on forks
if: github.repository_owner == 'prql'

steps:
- name: 📂 Checkout code
uses: actions/checkout@v3
- name: 📦 Build Snap
uses: snapcore/action-build@v1
with:
path: prql-compiler
- name: 🆙 Publish Snap
uses: snapcore/action-publish@v1
env:
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.STORE_LOGIN }}
with:
snap: ${{ steps.build.outputs.snap }}
release: edge
25 changes: 25 additions & 0 deletions prql-compiler/snap/snapcraft.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: prqlc # you probably want to 'snapcraft register <name>'
base: core22 # the base snap is the execution environment for this snap
version: "0.1" # just for humans, typically '1.2+git' or '1.3.2'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lower priority but before we merge — we should have this be correct version and have something like this in the prqlc Cargo.toml so it gets update on every release:

prql/prql-js/Cargo.toml

Lines 44 to 48 in b430f03

[[package.metadata.release.pre-release-replacements]]
exactly = 1
file = "package.json"
replace = '$1"{{version}}"'
search = '( "version": )"(\d+\.\d+\.\d+)"'

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

An alternative would be to set the version property to git which would expand it using the git describe command to something like 0.2.5-690-g311ccd9 as per the documentation. https://snapcraft.io/docs/snapcraft-yaml-reference

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great, good idea re git; this will give us a good result when we're on a tag

summary: Transpile PRQL queries into SQL! # 79 char long summary
description: |
PRQL is a modern language for transforming data — a simple, powerful,
pipelined SQL replacement.
issues: https://github.com/PRQL/prql/issues
source-code: https://github.com/PRQL/prql
website: https://prql-lang.org/
license: Apache-2.0
grade: devel # must be 'stable' to release into candidate/stable channels
confinement: strict

parts:
prqlc:
plugin: rust
source: .

apps:
prqlc:
command: bin/prqlc
plugs:
- home
- removable-media