-
Notifications
You must be signed in to change notification settings - Fork 3
ci: Release libtortillas to crates.io on merge to main branch
#144
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 6 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
03421ab
chore: Add required `package` fields in `Cargo.toml` for publishing
artrixdotdev a699b2d
chore: Bump version
artrixdotdev 7444501
ci: Create workflow for on-merge alpha publishing to crates.io
artrixdotdev b9dbac5
chore: Reset version
artrixdotdev ab6d5c2
Merge branch 'main' into ci/release
artrixdotdev 7d56420
ci: Verify package before prerelease
artrixdotdev 482b9f5
chore: Fix grammar in `libtortillas` description
artrixdotdev b9a5f95
ci: Add concurrency rules to prerelease
artrixdotdev File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,66 +1,68 @@ | ||
| name: ✅ Checks | ||
| on: | ||
| push: | ||
| branches: [ "main" ] | ||
| pull_request: | ||
| branches: [ "main" ] | ||
| # No long run pushes on main since it will be called by the release workflow | ||
| # push: | ||
| # branches: [ "main" ] | ||
| pull_request: | ||
| branches: ["main"] | ||
| workflow_call: | ||
|
|
||
| env: | ||
| CARGO_TERM_COLOR: always | ||
| RUSTFLAGS: "-C target-cpu=native" | ||
| CARGO_INCREMENTAL: 0 | ||
| RUST_BACKTRACE: 1 | ||
| CARGO_TERM_COLOR: always | ||
| RUSTFLAGS: "-C target-cpu=native" | ||
| CARGO_INCREMENTAL: 0 | ||
| RUST_BACKTRACE: 1 | ||
|
|
||
| jobs: | ||
| build_and_test: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: 📥 Checkout code | ||
| uses: actions/checkout@v4 | ||
| build_and_test: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: 📥 Checkout code | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: 🦀 Install Rust toolchain | ||
| uses: dtolnay/rust-toolchain@nightly | ||
| with: | ||
| components: clippy, rustfmt | ||
| - name: 🦀 Install Rust toolchain | ||
| uses: dtolnay/rust-toolchain@nightly | ||
| with: | ||
| components: clippy, rustfmt | ||
|
|
||
| - name: 💾 Rust Cache | ||
| uses: Swatinem/rust-cache@v2 | ||
| with: | ||
| shared-key: "build-cache" | ||
| - name: 💾 Rust Cache | ||
| uses: Swatinem/rust-cache@v2 | ||
| with: | ||
| shared-key: "build-cache" | ||
|
|
||
| - name: 🔨 Build | ||
| run: cargo build --verbose | ||
| - name: 🔨 Build | ||
| run: cargo build --verbose | ||
|
|
||
| - name: Install latest nextest release | ||
| uses: taiki-e/install-action@nextest | ||
| - name: Install latest nextest release | ||
| uses: taiki-e/install-action@nextest | ||
|
|
||
| - name: 🧪 Run tests | ||
| uses: actions-rs/cargo@v1 | ||
| with: | ||
| command: nextest | ||
| args: run --nocapture --no-fail-fast | ||
| - name: 🧪 Run tests | ||
| uses: actions-rs/cargo@v1 | ||
| with: | ||
| command: nextest | ||
| args: run --nocapture --no-fail-fast | ||
|
|
||
| lint: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: 📥 Checkout code | ||
| uses: actions/checkout@v4 | ||
| lint: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: 📥 Checkout code | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: 🦀 Install Rust toolchain | ||
| uses: dtolnay/rust-toolchain@nightly | ||
| with: | ||
| components: clippy, rustfmt | ||
| - name: 🦀 Install Rust toolchain | ||
| uses: dtolnay/rust-toolchain@nightly | ||
| with: | ||
| components: clippy, rustfmt | ||
|
|
||
| - name: 💾 Rust Cache | ||
| uses: Swatinem/rust-cache@v2 | ||
| with: | ||
| shared-key: "lint-cache" | ||
| - name: 💾 Rust Cache | ||
| uses: Swatinem/rust-cache@v2 | ||
| with: | ||
| shared-key: "lint-cache" | ||
|
|
||
| - name: 🔍 Run linter | ||
| run: cargo clippy --all-targets --all-features -- -D warnings | ||
| - name: 🔍 Run linter | ||
| run: cargo clippy --all-targets --all-features -- -D warnings | ||
|
|
||
| - name: 💅 Run format checker | ||
| run: cargo fmt --check | ||
| - name: 📖 Run doc linter | ||
| run: cargo doc --no-deps --document-private-items | ||
| - name: 💅 Run format checker | ||
| run: cargo fmt --check | ||
|
|
||
| - name: 📖 Run doc linter | ||
| run: cargo doc --no-deps --document-private-items | ||
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| name: Publish Prerelease | ||
|
|
||
| on: | ||
| push: | ||
| paths: | ||
| # Only run if these files are changed | ||
| - "**/Cargo.toml" | ||
| - "**/Cargo.lock" | ||
| - "**/*.rs" | ||
| branches: | ||
| - main | ||
|
|
||
| jobs: | ||
| checks: | ||
| uses: ./.github/workflows/checks.yml | ||
| publish-crates-io: | ||
| name: Publish prerelease to crates.io | ||
| runs-on: ubuntu-latest | ||
| needs: checks | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - name: Install Rust | ||
| uses: dtolnay/rust-toolchain@nightly | ||
|
|
||
| - name: Install cargo-edit | ||
| run: cargo install cargo-edit --locked | ||
|
|
||
| - name: Compute prerelease version | ||
| id: version | ||
| run: | | ||
| BASE_VERSION=$(cargo pkgid -p libtortillas | sed 's/.*#//') | ||
| PRERELEASE_VERSION="${BASE_VERSION}-alpha.${GITHUB_SHA::7}" | ||
| echo "prerelease_version=$PRERELEASE_VERSION" >> $GITHUB_OUTPUT | ||
|
|
||
artrixdotdev marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| - name: Set prerelease version | ||
| run: | | ||
| cargo set-version -p libtortillas --no-workspace ${{ steps.version.outputs.prerelease_version }} | ||
|
|
||
| - name: Verify package (pre-publish) | ||
| run: cargo package -p libtortillas --allow-dirty | ||
|
|
||
| - name: Publish to crates.io | ||
| env: | ||
| CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} | ||
| run: cargo publish -p libtortillas --allow-dirty | ||
This file contains hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.