-
Notifications
You must be signed in to change notification settings - Fork 1
129 lines (108 loc) · 4.18 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
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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
name: Publish
on:
workflow_dispatch:
push:
branches:
- main
tags: ["*"]
permissions:
contents: read
env:
CARGO_TERM_COLOR: always
PROTOC_VERSION: 3.23.4
jobs:
publish:
if: github.event.repository.fork == false
name: Publish release
runs-on: ubuntu-22.04
env:
CARGO_REGISTRIES_AKKA_RS_INDEX: https://dl.cloudsmith.io/${{ secrets.CLOUDSMITH_AKKA_RS_ENTITLEMENT_TOKEN }}/lightbend/akka-rs/cargo/index.git
CARGO_REGISTRIES_AKKA_RS_TOKEN: ${{ secrets.CLOUDSMITH_LIGHTBEND_MACHINE_API_KEY }}
steps:
- name: Checkout
# https://github.com/actions/checkout/releases
# v4.1.0
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608
- name: Update Rust
run: |
rustup update
- name: Install protoc
# https://github.com/taiki-e/install-action/releases
# v2.20.3
uses: taiki-e/install-action@47d27149ff6b3422864ec504071d5cc7873d642e
with:
tool: protoc@${{ env.PROTOC_VERSION }}
- name: Cache Rust
# https://github.com/Swatinem/rust-cache/releases
# v2.7.0
uses: Swatinem/rust-cache@a95ba195448af2da9b00fb742d14ffaaf3c21f43
- name: Publish akka-persistence-rs
if: startsWith(github.event.ref, 'refs/tags/v')
run: cargo publish --registry AKKA_RS -p akka-persistence-rs
- name: Publish akka-persistence-rs-commitlog
if: startsWith(github.event.ref, 'refs/tags/v')
run: cargo publish --registry AKKA_RS -p akka-persistence-rs-commitlog
- name: Publish akka-projection-rs
if: startsWith(github.event.ref, 'refs/tags/v')
run: cargo publish --registry AKKA_RS -p akka-projection-rs
- name: Publish akka-projection-rs-commitlog
if: startsWith(github.event.ref, 'refs/tags/v')
run: cargo publish --registry AKKA_RS -p akka-projection-rs-commitlog
- name: Publish akka-projection-rs-grpc
if: startsWith(github.event.ref, 'refs/tags/v')
run: cargo publish --registry AKKA_RS -p akka-projection-rs-grpc
documentation:
if: github.event.repository.fork == false
name: Documentation
# the release environment provides access to secrets required in the release process
# https://github.com/akka/akka-edge-rs/settings/environments
environment: release
runs-on: ubuntu-22.04
steps:
- name: Checkout
# https://github.com/actions/checkout/releases
# v4.1.0
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608
- name: Update Rust
run: |
rustup update
- name: Install protoc
# https://github.com/taiki-e/install-action/releases
# v2.20.3
uses: taiki-e/install-action@47d27149ff6b3422864ec504071d5cc7873d642e
with:
tool: protoc@${{ env.PROTOC_VERSION }}
- name: Cache Rust
# https://github.com/Swatinem/rust-cache/releases
# v2.7.0
uses: Swatinem/rust-cache@a95ba195448af2da9b00fb742d14ffaaf3c21f43
- name: Create API documentation
run: cargo doc --no-deps
- name: Copy index page
run: cp docs/index.html target/doc
- name: Publish API documentation (tag)
if: startsWith(github.event.ref, 'refs/tags/v')
env:
REFS_TAG: ${{ github.event.ref }}
AKKA_RSYNC_GUSTAV: ${{ secrets.AKKA_RSYNC_GUSTAV }}
RSYNC_RSH: "ssh -o StrictHostKeyChecking=no"
run: |+
eval "$(ssh-agent -s)"
echo $AKKA_RSYNC_GUSTAV | base64 -d > .github/id_rsa
chmod 600 .github/id_rsa
ssh-add .github/id_rsa
cd target/doc
TAG=$(echo $REFS_TAG | cut -d'/' -f 3)
rsync -azP ./ [email protected]:www/api/akka-edge-rs/${TAG}/
- name: Publish API documentation (snapshot)
if: ${{ ! startsWith(github.event.ref, 'refs/tags/') }}
env:
AKKA_RSYNC_GUSTAV: ${{ secrets.AKKA_RSYNC_GUSTAV }}
RSYNC_RSH: "ssh -o StrictHostKeyChecking=no"
run: |+
eval "$(ssh-agent -s)"
echo $AKKA_RSYNC_GUSTAV | base64 -d > .github/id_rsa
chmod 600 .github/id_rsa
ssh-add .github/id_rsa
cd target/doc
rsync -azP ./ [email protected]:www/api/akka-edge-rs/snapshot/