Skip to content

Commit ffa2e51

Browse files
authored
Merge pull request #461 from pksunkara/publish
Added scheduled release workflow
2 parents 329b7f3 + 5470bfc commit ffa2e51

File tree

3 files changed

+61
-13
lines changed

3 files changed

+61
-13
lines changed

.github/workflows/ci.yml

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,16 @@ jobs:
1616
rust: [stable, nightly]
1717
steps:
1818
- name: Checkout the source code
19-
uses: actions/checkout@master
19+
uses: actions/checkout@v2
2020
with:
2121
fetch-depth: 1
2222

23-
- name: Setup Rust ${{ matrix.rust }}
24-
run: rustup set profile minimal && rustup update ${{ matrix.rust }} --no-self-update && rustup default ${{ matrix.rust }}
23+
- name: Install Rust toolchain
24+
uses: actions-rs/toolchain@v1
25+
with:
26+
toolchain: ${{ matrix.rust }}
27+
profile: minimal
28+
override: true
2529

2630
- name: Build chalk-engine without default features
2731
run: cd chalk-engine && cargo build --no-default-features
@@ -69,27 +73,28 @@ jobs:
6973
runs-on: ubuntu-latest
7074
steps:
7175
- name: Checkout the source code
72-
uses: actions/checkout@master
76+
uses: actions/checkout@v2
7377
with:
7478
fetch-depth: 1
7579

76-
- name: Setup Rust stable with rustfmt
77-
run: |
78-
rustup set profile minimal
79-
rustup update stable --no-self-update
80-
rustup default stable
81-
rustup component add rustfmt
80+
- name: Install Rust toolchain
81+
uses: actions-rs/toolchain@v1
82+
with:
83+
toolchain: stable
84+
profile: minimal
85+
override: true
86+
components: rustfmt
8287

8388
- name: Check formatting of all crates in the workspace
8489
run: cargo fmt --all -- --check
85-
90+
8691
mdbook-linkcheck:
8792
name: Book link check
8893
runs-on: ubuntu-latest
8994
if: github.ref != 'refs/heads/master'
9095
steps:
9196
- name: Checkout the source code
92-
uses: actions/checkout@master
97+
uses: actions/checkout@v2
9398
with:
9499
fetch-depth: 1
95100

.github/workflows/publish.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Publish
2+
on:
3+
schedule:
4+
- cron: "0 0 * * 0" # midnight UTC on Sunday
5+
6+
jobs:
7+
publish:
8+
name: Publish
9+
runs-on: macos-latest
10+
11+
steps:
12+
- name: Checkout repository
13+
uses: actions/checkout@v2
14+
with:
15+
ssh-key: ${{ secrets.PUBLISH_DEPLOY_KEY }}
16+
fetch-depth: 0
17+
18+
- name: Install Rust toolchain
19+
uses: actions-rs/toolchain@v1
20+
with:
21+
toolchain: stable
22+
profile: minimal
23+
override: true
24+
25+
- name: Install cargo-workspaces
26+
uses: actions-rs/install@v0.1
27+
with:
28+
crate: cargo-workspaces
29+
30+
- name: Release
31+
env:
32+
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
33+
shell: bash
34+
run: |
35+
git config --global user.name "Github Action"
36+
cargo workspaces version -ay --force '*' --include-merged-tags --no-git-commit --exact patch
37+
export VERSION=$(cargo pkgid | sed -E 's/.*#(.*)/\1/g')
38+
sed -E -i '' $'s/(# Unreleased)/\\1\\\n\\\n# Release '"$VERSION/" RELEASES.md
39+
git commit -am "Release $VERSION"
40+
git tag "v$VERSION"
41+
git push --tags
42+
cargo publish --from-git
43+
cargo workspaces version -ay --force '*' --include-merged-tags --no-git-tag --pre-id dev preminor

chalk-solve/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ chalk-engine = { version = "0.10.1-dev", path = "../chalk-engine", optional = tr
2020
chalk-ir = { version = "0.10.1-dev", path = "../chalk-ir" }
2121

2222
[dev-dependencies]
23-
chalk-integration = { version = "0.10.1-dev", path = "../chalk-integration" }
23+
chalk-integration = { path = "../chalk-integration" }
2424

2525
[features]
2626
default = ["slg-solver", "recursive-solver"]

0 commit comments

Comments
 (0)