Skip to content

Commit 29e0c7f

Browse files
authored
Merge pull request #29 from salvo-rs/liquid
Refactor salvo-cli
2 parents 1fb59d1 + c2db993 commit 29e0c7f

File tree

138 files changed

+5172
-4340
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

138 files changed

+5172
-4340
lines changed

.github/workflows/release.yml

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
name: Release
2+
on:
3+
push:
4+
tags:
5+
- "v[0-9]+.[0-9]+.[0-9]+.*"
6+
7+
jobs:
8+
version-info:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: dtolnay/rust-toolchain@stable
12+
with:
13+
components: rustfmt, clippy
14+
15+
- name: Checkout
16+
uses: actions/checkout@v4
17+
18+
- name: Get releasing version
19+
working-directory: .
20+
run: echo NEXT_VERSION=$(sed -nE 's/^\s*version = "(.*?)"/\1/p' Cargo.toml) >> $GITHUB_ENV
21+
22+
- name: Check published version
23+
run: echo PREV_VERSION=$(cargo search salvo-cli --limit 1 | sed -nE 's/^[^"]*"//; s/".*//1p' -) >> $GITHUB_ENV
24+
25+
publish:
26+
runs-on: ubuntu-latest
27+
strategy:
28+
fail-fast: false
29+
max-parallel: 1
30+
matrix:
31+
package:
32+
- crate: salvo-cli
33+
path: ./
34+
steps:
35+
- uses: dtolnay/rust-toolchain@stable
36+
with:
37+
components: rustfmt, clippy
38+
39+
- name: Checkout
40+
uses: actions/checkout@v4
41+
42+
- name: Get releasing version
43+
working-directory: ${{ matrix.package.path }}
44+
run: echo NEXT_VERSION=$(sed -nE 's/^\s*version = "(.*?)"/\1/p' Cargo.toml) >> $GITHUB_ENV
45+
46+
- name: Check published version
47+
run: echo PREV_VERSION=$(cargo search ${{ matrix.package.crate }} --limit 1 | sed -nE 's/^[^"]*"//; s/".*//1p' -) >> $GITHUB_ENV
48+
49+
- name: Cargo login
50+
if: env.NEXT_VERSION != env.PREV_VERSION
51+
run: cargo login ${{ secrets.CRATES_TOKEN }}
52+
53+
- name: Cargo package
54+
if: env.NEXT_VERSION != env.PREV_VERSION
55+
working-directory: ${{ matrix.package.path }}
56+
run: |
57+
echo "Releasing version: $NEXT_VERSION"
58+
echo "Published version: $PREV_VERSION"
59+
echo "Cargo Packaging..."
60+
cargo package
61+
62+
- name: Publish ${{ matrix.package.name }}
63+
if: env.NEXT_VERSION != env.PREV_VERSION
64+
working-directory: ${{ matrix.package.path }}
65+
run: |
66+
echo "Cargo Publishing..."
67+
cargo publish --no-verify
68+
echo "New version $NEXT_VERSION has been published"

0 commit comments

Comments
 (0)