-
Notifications
You must be signed in to change notification settings - Fork 14
41 lines (34 loc) · 1.21 KB
/
publish.yml
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
name: publish
on:
push:
tags:
- v*
workflow_dispatch:
inputs:
dry_run:
type: boolean
default: false
jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
# I had a check here if the versions are already existing but magically with gh actions it returned a false
# positive.
- name: Publish internal
run: |
DRY_RUN=${{ github.event.inputs.dry_run }}
DRY_RUN=${DRY_RUN:-"false"}
cd internal && cargo publish $(if $DRY_RUN; then echo "--dry-run"; fi) --token ${{ secrets.CRATES_TOKEN }}
# Sleep 10 seconds if publishing. Without this the "Publish main" step fails as it can't find the correct
# crunchyroll-rs-internal version, since the step is faster than crates.io can process the new crunchyroll-rs-internal
# version
- name: Sleep in non dry run
if: github.event.inputs.dry_run != 'true'
run: sleep 10
- name: Publish main
run: |
DRY_RUN=${{ github.event.inputs.dry_run }}
DRY_RUN=${DRY_RUN:-"false"}
cargo publish $(if $DRY_RUN; then echo "--dry-run"; fi) --token ${{ secrets.CRATES_TOKEN }}