-
Notifications
You must be signed in to change notification settings - Fork 226
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
Add prql-compiler to snapcraft #762
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As much as I understand, this looks great, happy to see how this goes unless there's feedback from anyone else?
Thanks @paulomach!
@paulomach I'm sorry this didn't get another review. There was one very small issue that pre-commit caught (but didn't seem to fix automatically...) I've resolved the conflicts and included a new diff here. Would you be up for resetting to the current Should we set up a diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml
index aa9ca7a5..501f95fc 100644
--- a/.github/workflows/release.yaml
+++ b/.github/workflows/release.yaml
@@ -101,6 +101,18 @@ jobs:
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
+ publish-snapcraft:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v2
+ - uses: snapcore/action-build@v1
+ id: build
+ - uses: snapcore/action-publish@v1
+ env:
+ SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.STORE_LOGIN }}
+ with:
+ snap: ${{ steps.build.outputs.snap }}
+ release: stable
# Requires another pass: https://github.com/prql/prql/issues/850
# publish-prql-java:
# runs-on: ubuntu-latest
diff --git a/snapcraft.yaml b/snapcraft.yaml
new file mode 100644
index 00000000..125dafe0
--- /dev/null
+++ b/snapcraft.yaml
@@ -0,0 +1,46 @@
+name: prql-compiler
+adopt-info: prql-compiler
+base: core20
+summary: Pipelined Relational Query Language, pronounced "Prequel"
+description: |
+ PRQL is a modern language for transforming data — a simple, powerful,
+ pipelined SQL replacement. Like SQL, it's readable, explicit and
+ declarative. Unlike SQL, it forms a logical pipeline of transformations,
+ and supports abstractions such as variables and functions. It can be
+ used with any database that uses SQL, since it transpiles to SQL. *NOTE*:
+ this snap packs only the `prql-compiler`, and not the bindings.
+license: Apache-2.0
+grade: stable
+confinement: strict
+issues: https://github.com/prql/prql/issues
+source-code: https://github.com/prql/prql.git
+website: https://prql-lang.org/
+icon: website/static/img/icon.svg
+
+apps:
+ prql-compiler:
+ command: bin/prql-compiler
+ plugs:
+ - home
+ - removable-media
+
+parts:
+ prql-compiler:
+ plugin: rust
+ source: https://github.com/prql/prql.git
+ build-packages:
+ - rust-all
+ override-build: |
+ last_committed_tag="$(git describe --tags --abbrev=0)"
+ last_committed_tag_ver="$(echo ${last_committed_tag} | sed 's/v//')"
+ last_released_tag="$(snap info $SNAPCRAFT_PROJECT_NAME | awk '$1 == "beta:" { print $2 }' || echo '0.0.0')"
+ # If the latest tag from the upstream project has not been released to
+ # beta, build that tag instead of master.
+ if [ "${last_committed_tag_ver}" != "${last_released_tag}" ]; then
+ git fetch
+ git checkout "${last_committed_tag}"
+ cd ../src
+ git checkout "${last_committed_tag}"
+ fi
+ cargo install --locked --path prql-compiler --root /root/parts/prql-compiler/install --force
+ snapcraftctl set-version $(git -C ../src describe --tags | sed 's/v//') |
Closing as stale unfortunately. Much of that is my fault for not seeing a follow up commit for a while and so it not receiving a timely review. Feel free to reopen or create a new PR, either @paulomach or a new contributor. @paulomach thanks for starting this off! We appreciate it. |
@paulomach We have now merged a PR that adds Snap support. #1881 |
This PR is:
snapcraft.yaml
: metadata for publishing on snapcraft - it uses the semver tags on branchmain
to choose latest release.github/workflows/release.yml
: job for auto-publishing to snapcraft. As per documentation, requires a repo secret to be added. This will require coordination over the discord channel.The snap is already published under version 0.2.0, available at https://snapcraft.io/prql-compiler