-
Notifications
You must be signed in to change notification settings - Fork 123
51 lines (45 loc) · 2.14 KB
/
release.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
name: Release
on:
workflow_dispatch:
inputs:
tag:
type: string
description: What tag to release
push:
branches:
- DO-2216
permissions:
contents: write
jobs:
update-cargo-version:
name: Update the cargo version
runs-on: ubuntu-latest
steps:
- uses: RDXWorks-actions/checkout@main
- name: Update cargo version
run: |
set -ex
export VERSION=0.0.0
cargo install toml-cli
FILES=("monkey-tests/Cargo.toml" "native-sdk/Cargo.toml" "radix-engine-common/Cargo.toml" "radix-engine-derive/Cargo.toml" "radix-engine-interface/Cargo.toml" "radix-engine-macros/Cargo.toml" "radix-engine-profiling/Cargo.toml" "radix-engine-queries/Cargo.toml" "radix-engine-store-interface/Cargo.toml" "radix-engine-stores/Cargo.toml" "radix-engine-tests/Cargo.toml" "radix-engine/Cargo.toml" "sbor-derive-common/Cargo.toml" "sbor-derive/Cargo.toml" "sbor-tests/Cargo.toml" "sbor/Cargo.toml" "scrypto-derive-tests/Cargo.toml" "scrypto-derive/Cargo.toml" "scrypto-schema/Cargo.toml" "scrypto-test/Cargo.toml" "scrypto-unit/Cargo.toml" "scrypto/Cargo.toml" "simulator/Cargo.toml" "transaction-scenarios/Cargo.toml" "transaction/Cargo.toml" "utils/Cargo.toml")
for t in ${FILES[@]}; do
FILENAME=$t
mv "${FILENAME}" "${FILENAME}.old"
toml set "${FILENAME}.old" package.version "${VERSION}" > "${FILENAME}"
rm "${FILENAME}.old"
done
maxi=$(toml get simulator/Cargo.lock package | jq length)
for (( i=0; c<$maxi; i++ ))
do
if [[ "${FILES[@]}" =~ $value ]]; then
toml set "simulator/Cargo.lock" "package[$i].version" "${VERSION}" > "simulator/Cargo.lock.new"
mv simulator/Cargo.lock.new simulator/Cargo.lock
fi;
done
rm -f simulator/Cargo.lock.new
git config --global user.name 'DevOps Team'
git config --global user.email '[email protected]'
git commit -am "BUMP VERSION to ${VERSION}"
git branch -v -l > branch.txt
cat branch.txt
git push