-
Notifications
You must be signed in to change notification settings - Fork 1
124 lines (115 loc) · 4.68 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
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Publishes tagged version to crates.io and to GitHub Packages NPM
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
name: Publish tagged crates and NPMs
on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]'
env:
REGISTRY: "https://npm.pkg.github.com"
SDK_JS_PACKAGE_NAME: "@kindredgroup/cohort_sdk_js"
DIR_SDK_JS: packages/cohort_sdk_js
DIR_SDK_JS_CLIENT: cohort_sdk_client
jobs:
publish:
name: Publish crates
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
- run: scripts/ubuntu-setup.sh
- run: rustup component add rustfmt clippy
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: 16
check-latest: true
registry-url: "https://npm.pkg.github.com"
- name: "Extract tag name"
shell: bash
run: |-
echo "VERSION_NAME=${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENV
- name: "Publish ${{ env.DIR_SDK_JS }} NPM"
shell: bash
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |-
currentDir=$(pwd)
cd $DIR_SDK_JS
pwd
ls -l
echo "Current version is"
npm version
npm publish --foreground-scripts
echo ""
- name: "Publish ${{ env.DIR_SDK_JS_CLIENT }} NPM"
shell: bash
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |-
currentDir=$(pwd)
cd $DIR_SDK_JS_CLIENT
pwd
ls -l
echo "Current version is"
echo "Updating $SDK_JS_PACKAGE_NAME to $VERSION_NAME"
rm package-lock.json || true
echo "D: npm install $SDK_JS_PACKAGE_NAME@$VERSION_NAME --foreground-scripts"
npm install $SDK_JS_PACKAGE_NAME@$VERSION_NAME --foreground-scripts
npm version
npm publish --foreground-scripts
echo ""
cd $currentDir
- name: Publish talos_metrics@ ${{ env.VERSION_NAME }} crate
shell: bash
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN_TALOS }}
run: |-
cargo publish -v -p talos_metrics
- name: Publish talos_suffix@ ${{ env.VERSION_NAME }} crate
shell: bash
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN_TALOS }}
run: |-
cargo publish -v -p talos_suffix
- name: Publish talos_certifier@ ${{ env.VERSION_NAME }} crate
shell: bash
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN_TALOS }}
run: |-
cargo publish -v -p talos_certifier
- name: Publish talos_common_utils@ ${{ env.VERSION_NAME }} crate
shell: bash
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN_TALOS }}
run: |-
cargo publish -v -p talos_common_utils
- name: Publish talos_rdkafka_utils@ ${{ env.VERSION_NAME }} crate
shell: bash
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN_TALOS }}
run: |-
cargo publish -v -p talos_rdkafka_utils
- name: Publish talos_certifier_adapters@ ${{ env.VERSION_NAME }} crate
shell: bash
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN_TALOS }}
run: |-
cargo publish -v -p talos_certifier_adapters
# Talos messenger core
- name: Publish talos_messenger_core@ ${{ env.VERSION_NAME }} crate
shell: bash
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN_TALOS }}
run: |-
cargo publish -v -p talos_messenger_core
# Talos messenger actions
- name: Publish talos_messenger_actions@ ${{ env.VERSION_NAME }} crate
shell: bash
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN_TALOS }}
run: |-
cargo publish -v -p talos_messenger_actions