Skip to content

Commit 5b074bb

Browse files
committed
make releases easier
1 parent 2acb6aa commit 5b074bb

File tree

6 files changed

+442
-24
lines changed

6 files changed

+442
-24
lines changed

.cargo/config.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[alias]
2+
xtask = "run --package xtask --"

.github/workflows/ci.yml

Lines changed: 19 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,26 @@ on:
1010
jobs:
1111
ci:
1212
name: CI
13-
needs: [test, fmt, clippy, docs]
13+
needs: [test, fmt, clippy, docs, release]
1414
runs-on: ubuntu-latest
1515
steps:
1616
- name: Done
1717
run: exit 0
18+
release:
19+
name: Release
20+
runs-on: ubuntu-latest
21+
needs: [test, fmt, clippy, docs]
22+
steps:
23+
- uses: actions/checkout@v3
24+
with:
25+
submodules: recursive
26+
fetch-depth: 0 # fetch tags for publish
27+
# ssh-key: "${{ secrets.COMMIT_KEY }}" # use deploy key to trigger workflow on tag
28+
- uses: Swatinem/rust-cache@v2
29+
- run: cargo xtask release
30+
env:
31+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
32+
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
1833
test:
1934
name: Tests
2035
strategy:
@@ -48,7 +63,7 @@ jobs:
4863
uses: actions-rs/cargo@v1
4964
with:
5065
command: test
51-
args: --all-targets --features "${{ env.CI_TWITCH_OAUTH2_FEATURES }}"
66+
args: --all-targets --features "${{ env.CI_TWITCH_OAUTH2_FEATURES }}" --workspace
5267
fmt:
5368
name: Rustfmt
5469
runs-on: ubuntu-latest
@@ -91,11 +106,11 @@ jobs:
91106
with:
92107
command: clippy
93108
args: --locked
94-
- name: Run clippy --all-targets --all-features
109+
- name: Run clippy --all-targets --all-features --workspace
95110
uses: actions-rs/cargo@v1
96111
with:
97112
command: clippy
98-
args: --locked --all-targets --all-features
113+
args: --locked --all-targets --all-features --workspace
99114
docs:
100115
name: Docs
101116
runs-on: ubuntu-latest
@@ -130,21 +145,3 @@ jobs:
130145
with:
131146
command: doc
132147
args: --locked --no-deps --features "${{ env.CI_TWITCH_OAUTH2_FEATURES }}"
133-
release:
134-
name: Release
135-
runs-on: ubuntu-latest
136-
if: startsWith(github.head_ref, 'release-') || startsWith(github.ref, 'release-')
137-
steps:
138-
- uses: actions/checkout@v2
139-
with:
140-
submodules: false
141-
- uses: actions-rs/toolchain@v1
142-
with:
143-
profile: minimal
144-
toolchain: nightly
145-
override: true
146-
- name: Run dry run publish
147-
uses: actions-rs/cargo@v1
148-
with:
149-
command: publish
150-
args: --dry-run --features "${{ env.CI_TWITCH_OAUTH2_FEATURES }}"

0 commit comments

Comments
 (0)