Skip to content
Open
Show file tree
Hide file tree
Changes from all 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
72 changes: 72 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: CI

on:
push:
branches: [main]
pull_request:
branches: [main]

permissions:
contents: read

concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true

env:
CARGO_TERM_COLOR: always

jobs:
fmt:
name: cargo fmt
continue-on-error: true
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Comment thread
coderabbitai[bot] marked this conversation as resolved.
with:
persist-credentials: false
- uses: dtolnay/rust-toolchain@1.91
with:
components: rustfmt
- run: cargo fmt --all -- --check

clippy:
name: cargo clippy
continue-on-error: true
runs-on: ubuntu-latest
env:
SQLX_OFFLINE: true
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- uses: dtolnay/rust-toolchain@1.91
with:
components: clippy
- uses: Swatinem/rust-cache@v2
- run: cargo clippy --all-targets --all-features -- -D warnings

test:
name: cargo test
continue-on-error: true
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- uses: dtolnay/rust-toolchain@1.91
- uses: Swatinem/rust-cache@v2
- run: cargo test --all-targets --all-features

integration:
name: integration tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- run: test/integration.sh
22 changes: 0 additions & 22 deletions .github/workflows/clippy.yml

This file was deleted.

77 changes: 53 additions & 24 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,19 +56,19 @@ jobs:
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
with:
persist-credentials: false
submodules: recursive
- name: Install Rust
run: rustup update "1.88.0" --no-self-update && rustup default "1.88.0"
run: rustup update "1.91" --no-self-update && rustup default "1.91"
- name: Install dist
# we specify bash to get pipefail; it guards against the `curl` command
# failing. otherwise `sh` won't catch that `curl` returned non-0
shell: bash
run: "curl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/cargo-dist/releases/download/v0.30.3/cargo-dist-installer.sh | sh"
run: "curl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/cargo-dist/releases/download/v0.31.0/cargo-dist-installer.sh | sh"
- name: Cache dist
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v6
with:
name: cargo-dist-cache
path: ~/.cargo/bin/dist
Expand All @@ -84,7 +84,7 @@ jobs:
cat plan-dist-manifest.json
echo "manifest=$(jq -c "." plan-dist-manifest.json)" >> "$GITHUB_OUTPUT"
- name: "Upload dist-manifest.json"
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v6
with:
name: artifacts-plan-dist-manifest
path: plan-dist-manifest.json
Expand Down Expand Up @@ -118,7 +118,7 @@ jobs:
- name: enable windows longpaths
run: |
git config --global core.longpaths true
- uses: actions/checkout@v4
- uses: actions/checkout@v6
with:
persist-credentials: false
submodules: recursive
Expand All @@ -130,12 +130,12 @@ jobs:
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
fi
- name: Use rustup to set correct Rust version
run: rustup update "1.88.0" --no-self-update && rustup default "1.88.0"
run: rustup update "1.91" --no-self-update && rustup default "1.91"
- name: Install dist
run: ${{ matrix.install_dist.run }}
# Get the dist-manifest
- name: Fetch local artifacts
uses: actions/download-artifact@v4
uses: actions/download-artifact@v7
with:
pattern: artifacts-*
path: target/distrib/
Expand All @@ -162,7 +162,7 @@ jobs:

cp dist-manifest.json "$BUILD_MANIFEST_NAME"
- name: "Upload artifacts"
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v6
with:
name: artifacts-build-local-${{ join(matrix.targets, '_') }}
path: |
Expand All @@ -179,21 +179,21 @@ jobs:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BUILD_MANIFEST_NAME: target/distrib/global-dist-manifest.json
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
with:
persist-credentials: false
submodules: recursive
- name: Install Rust
run: rustup update "1.88.0" --no-self-update && rustup default "1.88.0"
run: rustup update "1.91" --no-self-update && rustup default "1.91"
- name: Install cached dist
uses: actions/download-artifact@v4
uses: actions/download-artifact@v7
with:
name: cargo-dist-cache
path: ~/.cargo/bin/
- run: chmod +x ~/.cargo/bin/dist
# Get all the local artifacts for the global tasks to use (for e.g. checksums)
- name: Fetch local artifacts
uses: actions/download-artifact@v4
uses: actions/download-artifact@v7
with:
pattern: artifacts-*
path: target/distrib/
Expand All @@ -211,7 +211,7 @@ jobs:

cp dist-manifest.json "$BUILD_MANIFEST_NAME"
- name: "Upload artifacts"
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v6
with:
name: artifacts-build-global
path: |
Expand All @@ -231,21 +231,21 @@ jobs:
outputs:
val: ${{ steps.host.outputs.manifest }}
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
with:
persist-credentials: false
submodules: recursive
- name: Install Rust
run: rustup update "1.88.0" --no-self-update && rustup default "1.88.0"
run: rustup update "1.91" --no-self-update && rustup default "1.91"
- name: Install cached dist
uses: actions/download-artifact@v4
uses: actions/download-artifact@v7
with:
name: cargo-dist-cache
path: ~/.cargo/bin/
- run: chmod +x ~/.cargo/bin/dist
# Fetch artifacts from scratch-storage
- name: Fetch artifacts
uses: actions/download-artifact@v4
uses: actions/download-artifact@v7
with:
pattern: artifacts-*
path: target/distrib/
Expand All @@ -258,14 +258,14 @@ jobs:
cat dist-manifest.json
echo "manifest=$(jq -c "." dist-manifest.json)" >> "$GITHUB_OUTPUT"
- name: "Upload dist-manifest.json"
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v6
with:
# Overwrite the previous copy
name: artifacts-dist-manifest
path: dist-manifest.json
# Create a GitHub Release while uploading all files to it
- name: "Download GitHub Artifacts"
uses: actions/download-artifact@v4
uses: actions/download-artifact@v7
with:
pattern: artifacts-*
path: artifacts
Expand Down Expand Up @@ -298,14 +298,14 @@ jobs:
GITHUB_EMAIL: "admin+bot@axo.dev"
if: ${{ !fromJson(needs.plan.outputs.val).announcement_is_prerelease || fromJson(needs.plan.outputs.val).publish_prereleases }}
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
with:
persist-credentials: true
repository: "txpipe/homebrew-tap"
token: ${{ secrets.HOMEBREW_TAP_TOKEN }}
# So we have access to the formula
- name: Fetch homebrew formulae
uses: actions/download-artifact@v4
uses: actions/download-artifact@v7
with:
pattern: artifacts-*
path: Formula/
Expand All @@ -332,20 +332,49 @@ jobs:
done
git push

publish-npm:
needs:
- plan
- host
runs-on: "ubuntu-22.04"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PLAN: ${{ needs.plan.outputs.val }}
if: ${{ !fromJson(needs.plan.outputs.val).announcement_is_prerelease || fromJson(needs.plan.outputs.val).publish_prereleases }}
steps:
- name: Fetch npm packages
uses: actions/download-artifact@v7
with:
pattern: artifacts-*
path: npm/
merge-multiple: true
- uses: actions/setup-node@v6
with:
node-version: '20.x'
registry-url: 'https://registry.npmjs.org'
- run: |
for release in $(echo "$PLAN" | jq --compact-output '.releases[] | select([.artifacts[] | endswith("-npm-package.tar.gz")] | any)'); do
pkg=$(echo "$release" | jq '.artifacts[] | select(endswith("-npm-package.tar.gz"))' --raw-output)
npm publish --access public "./npm/${pkg}"
done
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

announce:
needs:
- plan
- host
- publish-homebrew-formula
- publish-npm
# use "always() && ..." to allow us to wait for all publish jobs while
# still allowing individual publish jobs to skip themselves (for prereleases).
# "host" however must run to completion, no skipping allowed!
if: ${{ always() && needs.host.result == 'success' && (needs.publish-homebrew-formula.result == 'skipped' || needs.publish-homebrew-formula.result == 'success') }}
if: ${{ always() && needs.host.result == 'success' && (needs.publish-homebrew-formula.result == 'skipped' || needs.publish-homebrew-formula.result == 'success') && (needs.publish-npm.result == 'skipped' || needs.publish-npm.result == 'success') }}
runs-on: "ubuntu-22.04"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
with:
persist-credentials: false
submodules: recursive
28 changes: 0 additions & 28 deletions .github/workflows/test.yml

This file was deleted.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,11 @@ lto = "thin"
[workspace.metadata.release]
push = false
publish = false
tag-name = "v{{version}}"
pre-release-hook = [
"git",
"cliff",
"-o",
"CHANGELOG.md",
"--tag",
"{{version}}",
"--tag", "v{{version}}",
]
24 changes: 6 additions & 18 deletions dist-workspace.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,36 +3,24 @@ members = ["cargo:."]

# Config for 'dist'
[dist]
# The preferred dist version to use in CI (Cargo.toml SemVer syntax)
cargo-dist-version = "0.30.3"
# CI backends to support
cargo-dist-version = "0.31.0"
ci = "github"
# The installers to generate for each app
installers = ["shell", "powershell", "npm", "homebrew"]
# A GitHub repo to push Homebrew formulas to
tap = "txpipe/homebrew-tap"
# Target platforms to build apps for (Rust target-triple syntax)
targets = ["aarch64-apple-darwin", "aarch64-unknown-linux-gnu", "x86_64-unknown-linux-gnu", "x86_64-pc-windows-msvc"]
# Publish jobs to run in CI
publish-jobs = ["homebrew"]
# Which actions to run on pull requests
publish-jobs = ["homebrew", "npm"]
publish-prereleases = true
pr-run-mode = "plan"
# Whether to install an updater program
install-updater = false
# The preferred Rust toolchain to use in CI (rustup toolchain syntax)
rust-toolchain-version = "1.88.0"
# The archive format to use for windows builds (defaults .zip)
rust-toolchain-version = "1.91"
windows-archive = ".tar.gz"
# The archive format to use for non-windows builds (defaults .tar.xz)
unix-archive = ".tar.gz"
# A namespace to use when publishing this package to the npm registry
npm-scope = "@txpipe"
# Path that installers should place binaries in
install-path = "CARGO_HOME"

[dist.github-custom-runners]
global = "ubuntu-22.04"
x86_64-unknown-linux-gnu = "ubuntu-22.04"
aarch64-apple-darwin = "macos-14"
x86_64-apple-darwin = "macos-13"
aarch64-apple-darwin = "macos-15"
x86_64-pc-windows-msvc = "windows-2022"
aarch64-unknown-linux-gnu = "ubuntu-22.04-arm"
3 changes: 3 additions & 0 deletions rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[toolchain]
channel = "1.91"
components = ["rustfmt", "clippy"]
Loading