-
Notifications
You must be signed in to change notification settings - Fork 3
46 lines (38 loc) · 1.34 KB
/
release.yml
File metadata and controls
46 lines (38 loc) · 1.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
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
- 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