avoid running pipelines on workflow file changes #8
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |