Skip to content

Commit 2f6e26c

Browse files
committed
add release workflow for verifying release
also caches target folder
1 parent 96f3604 commit 2f6e26c

File tree

1 file changed

+28
-4
lines changed

1 file changed

+28
-4
lines changed

.github/workflows/ci.yml

Lines changed: 28 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,9 @@ jobs:
3838
uses: actions/cache@v1
3939
id: cache
4040
with:
41-
path: ~/.cargo
41+
path: |
42+
~/.cargo
43+
target
4244
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
4345
- name: Test twitch_api2
4446
uses: actions-rs/cargo@v1
@@ -81,7 +83,9 @@ jobs:
8183
uses: actions/cache@v1
8284
id: cache
8385
with:
84-
path: ~/.cargo
86+
path: |
87+
~/.cargo
88+
target
8589
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
8690
- name: Run clippy --all-targets --no-default-features -- -D warnings
8791
uses: actions-rs/clippy-check@v1
@@ -129,7 +133,9 @@ jobs:
129133
uses: actions/cache@v1
130134
id: cache
131135
with:
132-
path: ~/.cargo
136+
path: |
137+
~/.cargo
138+
target
133139
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
134140
# We do the following to make sure docs.rs can document properly without anything broken, and that docs are working.
135141
- name: Run doc tests
@@ -141,4 +147,22 @@ jobs:
141147
uses: actions-rs/cargo@v1
142148
with:
143149
command: doc
144-
args: --no-deps --features "${{ env.CI_TWITCH_API2_FEATURES }}"
150+
args: --no-deps --features "${{ env.CI_TWITCH_API2_FEATURES }}"
151+
release:
152+
name: Release
153+
runs-on: ubuntu-latest
154+
if: startsWith(github.head_ref, 'release-') || startsWith(github.ref, 'release-')
155+
steps:
156+
- uses: actions/checkout@v2
157+
with:
158+
submodules: false
159+
- uses: actions-rs/toolchain@v1
160+
with:
161+
profile: minimal
162+
toolchain: nightly
163+
override: true
164+
- name: Run dry run publish
165+
uses: actions-rs/cargo@v1
166+
with:
167+
command: publish
168+
args: --dry-run --features "${{ env.CI_TWITCH_OAUTH2_FEATURES }}"

0 commit comments

Comments
 (0)