-
Notifications
You must be signed in to change notification settings - Fork 15
82 lines (67 loc) · 2.08 KB
/
release.yaml
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
name: 𝌚 Release
on:
workflow_dispatch:
inputs:
force-publish:
required: true
type: boolean
description: Publish Releases at Anytime
workflow_run:
workflows: [ 🧪 Tests and Checks ]
branches: [main]
types: [ completed ]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
release-please:
runs-on: ubuntu-latest
if: >
github.ref == 'refs/heads/main' &&
github.repository_owner == 'ucan-wg' &&
github.event_name == 'workflow_dispatch' || github.event.workflow_run.conclusion == 'success'
outputs:
releases_created: ${{ steps.release.outputs['ucan--release_created'] || steps.release.outputs['ucan-key-support--release_created'] }}
steps:
- name: Run release-please
id: release
uses: google-github-actions/release-please-action@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
default-branch: main
command: manifest
extra-files: |
README.md
publish-release:
runs-on: ubuntu-latest
needs: [ release-please ]
permissions:
contents: write
pull-requests: write
if: ${{ needs.release-please.outputs.releases_created || github.event.inputs.force-publish }}
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Cache Project
uses: Swatinem/rust-cache@v2
- name: Install Rust Toolchain
uses: actions-rs/toolchain@v1
with:
override: true
profile: minimal
toolchain: stable
- name: Install Cargo Workspaces
env:
RUSTFLAGS: '-Copt-level=1'
uses: actions-rs/cargo@v1
with:
args: --force cargo-workspaces
command: install
- name: Verify Publishing of crate
uses: katyo/publish-crates@v1
with:
dry-run: true
- name: Cargo Publish to crates.io
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
run: cargo workspaces publish --from-git --allow-dirty