CI BUGFIX: Increment version for NPM, crates.io and release (#49)

This commit is contained in:
folex 2020-12-23 19:05:50 +03:00 committed by GitHub
parent 51754016f7
commit 6e5efe4903
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 29 additions and 32 deletions

View File

@ -48,7 +48,7 @@ jobs:
command: update
args: --aggressive
### Calculate MAX_VERSION
### Calculate FINAL_VERSION
- name: Install jq & sponge
run: sudo apt-get update && sudo apt-get --yes --force-yes install jq moreutils
@ -62,7 +62,8 @@ jobs:
JS_VERSION="$(yarn info --silent @fluencelabs/aquamarine-stepper version || true)"
RS_VERSION="$((cargo show --json air-interpreter-wasm | jq -r .crate.max_version) 2>/dev/null || true)"
MAX_VERSION="$(semver "$JS_VERSION" "$RS_VERSION" "0.0.0" | tail -n1)"
echo "MAX_VERSION=$MAX_VERSION" | tee -a $GITHUB_ENV
FINAL_VERSION="$(semver --increment patch "$MAX_VERSION")"
echo "FINAL_VERSION=$FINAL_VERSION" | tee -a $GITHUB_ENV
### === JavaScript package release ===
- name: Install wasm-pack
@ -115,10 +116,8 @@ jobs:
mv pkg/package_new.json pkg/package.json
### Set version
- run: yarn version --new-version ${{ env.MAX_VERSION }} --no-git-tag-version
working-directory: pkg
### Increment patch component of the version
- run: yarn version --patch --no-git-tag-version
- name: Set version to ${{ env.FINAL_VERSION }}
run: yarn version --new-version ${{ env.FINAL_VERSION }} --no-git-tag-version
working-directory: pkg
### Add README so it appears on npmjs.org
@ -147,10 +146,10 @@ jobs:
- name: Copy aquamarine.wasm to air-interpreter-wasm
run: cp target/wasm32-wasi/release/aquamarine.wasm crates/air-interpreter-wasm/aquamarine.wasm
- name: Set project version to MAX_VERSION
- name: Set project version to ${{ env.FINAL_VERSION }}
run: |
PATH="~/.cargo/bin:$PATH"
toml set Cargo.toml package.version "${{ env.MAX_VERSION }}" | sponge Cargo.toml
toml set Cargo.toml package.version "${{ env.FINAL_VERSION }}" | sponge Cargo.toml
working-directory: crates/air-interpreter-wasm
- name: Login to crates.io
@ -164,9 +163,9 @@ jobs:
- uses: marvinpinto/action-automatic-releases@latest
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "${{ env.MAX_VERSION }}"
automatic_release_tag: "${{ env.FINAL_VERSION }}"
prerelease: true
title: "Aquamarine ${{ env.MAX_VERSION }}"
title: "Aquamarine ${{ env.FINAL_VERSION }}"
files: |
LICENSE
target/wasm32-wasi/release/aquamarine.wasm

View File

@ -57,7 +57,7 @@ jobs:
command: update
args: --aggressive
### Calculate MAX_VERSION
### Calculate FINAL_VERSION
- name: Install jq & sponge
run: sudo apt-get update && sudo apt-get --yes --force-yes install jq moreutils
@ -71,7 +71,8 @@ jobs:
JS_VERSION="$(yarn info --silent @fluencelabs/aquamarine-stepper-${{ env.BRANCH_NAME }} version || true)"
RS_VERSION="$((cargo show --json air-interpreter-wasm-${{ env.BRANCH_NAME }} | jq -r .crate.max_version) 2>/dev/null || true)"
MAX_VERSION="$(semver "$JS_VERSION" "$RS_VERSION" "0.0.0" | tail -n1)"
echo "MAX_VERSION=$MAX_VERSION" | tee -a $GITHUB_ENV
FINAL_VERSION="$(semver --increment patch "$MAX_VERSION")"
echo "FINAL_VERSION=$FINAL_VERSION" | tee -a $GITHUB_ENV
### === JavaScript package release ===
- name: Install wasm-pack
@ -129,12 +130,8 @@ jobs:
- run: yarn version --new-version 0.0.0 --no-git-tag-version
working-directory: pkg
### Set version to MAX_VERSION
- run: yarn version --new-version ${{ env.MAX_VERSION }} --no-git-tag-version || true
working-directory: pkg
### Increment patch component of the version
- run: yarn version --patch --no-git-tag-version
### Set version to FINAL_VERSION
- run: yarn version --new-version ${{ env.FINAL_VERSION }} --no-git-tag-version || true
working-directory: pkg
### Add README so it appears on npmjs.org
@ -168,10 +165,10 @@ jobs:
- name: Copy aquamarine.wasm to air-interpreter-wasm
run: cp target/wasm32-wasi/release/aquamarine.wasm crates/air-interpreter-wasm/aquamarine.wasm
- name: Set project version to MAX_VERSION & add branch to its name
- name: Set project version to ${{ env.FINAL_VERSION }}_${{ env.BRANCH_NAME }}
run: |
PATH="~/.cargo/bin:$PATH"
toml set Cargo.toml package.version "${{ env.MAX_VERSION }}" | sponge Cargo.toml
toml set Cargo.toml package.version "${{ env.FINAL_VERSION }}" | sponge Cargo.toml
NAME=$(toml get Cargo.toml package.name | jq -r .)
toml set Cargo.toml package.name "${NAME}_${BRANCH_NAME}" | sponge Cargo.toml

23
Cargo.lock generated
View File

@ -70,7 +70,7 @@ dependencies = [
[[package]]
name = "aquamarine-vm"
version = "0.1.6"
source = "git+https://github.com/fluencelabs/fce#f022a2dec4229f1dd739794e98a0e5d080ea13d5"
source = "git+https://github.com/fluencelabs/fce?branch=master#f022a2dec4229f1dd739794e98a0e5d080ea13d5"
dependencies = [
"fluence-faas 0.1.18 (git+https://github.com/fluencelabs/fce)",
"maplit",
@ -654,7 +654,7 @@ dependencies = [
[[package]]
name = "fce"
version = "0.1.14"
source = "git+https://github.com/fluencelabs/fce#f022a2dec4229f1dd739794e98a0e5d080ea13d5"
source = "git+https://github.com/fluencelabs/fce?branch=master#f022a2dec4229f1dd739794e98a0e5d080ea13d5"
dependencies = [
"boolinator",
"fce-utils 0.1.0 (git+https://github.com/fluencelabs/fce)",
@ -682,7 +682,7 @@ checksum = "dcdd9d63fa5f87e03514ba8ca3bb91a25121bbf1c63a26df710f166ab8f274f7"
[[package]]
name = "fce-utils"
version = "0.1.0"
source = "git+https://github.com/fluencelabs/fce#f022a2dec4229f1dd739794e98a0e5d080ea13d5"
source = "git+https://github.com/fluencelabs/fce?branch=master#f022a2dec4229f1dd739794e98a0e5d080ea13d5"
[[package]]
name = "fce-wit-interfaces"
@ -697,7 +697,7 @@ dependencies = [
[[package]]
name = "fce-wit-interfaces"
version = "0.1.9"
source = "git+https://github.com/fluencelabs/fce#f022a2dec4229f1dd739794e98a0e5d080ea13d5"
source = "git+https://github.com/fluencelabs/fce?branch=master#f022a2dec4229f1dd739794e98a0e5d080ea13d5"
dependencies = [
"multimap",
"wasmer-interface-types-fl",
@ -720,7 +720,7 @@ dependencies = [
[[package]]
name = "fce-wit-parser"
version = "0.1.11"
source = "git+https://github.com/fluencelabs/fce#f022a2dec4229f1dd739794e98a0e5d080ea13d5"
source = "git+https://github.com/fluencelabs/fce?branch=master#f022a2dec4229f1dd739794e98a0e5d080ea13d5"
dependencies = [
"anyhow",
"fce-wit-interfaces 0.1.9 (git+https://github.com/fluencelabs/fce)",
@ -788,7 +788,7 @@ dependencies = [
[[package]]
name = "fluence-faas"
version = "0.1.18"
source = "git+https://github.com/fluencelabs/fce#f022a2dec4229f1dd739794e98a0e5d080ea13d5"
source = "git+https://github.com/fluencelabs/fce?branch=master#f022a2dec4229f1dd739794e98a0e5d080ea13d5"
dependencies = [
"cmd_lib",
"fce 0.1.14 (git+https://github.com/fluencelabs/fce)",
@ -1039,9 +1039,10 @@ dependencies = [
]
[[package]]
name = "jsonpath_lib"
version = "0.2.5"
source = "git+https://github.com/fluencelabs/jsonpath?branch=fluence#538b433ae2ccbd882ff02fcff22ea16be779fb6f"
name = "jsonpath_lib-fl"
version = "0.2.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "243653439f0992adf0bbf6ed5b798966fdbacd417b9dcb025b50200ec20c17ff"
dependencies = [
"array_tool",
"env_logger",
@ -1684,7 +1685,7 @@ dependencies = [
[[package]]
name = "stepper-interface"
version = "0.1.0"
source = "git+https://github.com/fluencelabs/aquamarine#724117547205d8ccc742d325b542af8f3df801b8"
source = "git+https://github.com/fluencelabs/aquamarine?branch=master#51754016f701aa9dd45661b4dfd78ee01533fabc"
dependencies = [
"fluence",
"serde",
@ -1703,7 +1704,7 @@ dependencies = [
"env_logger",
"fluence",
"fluence-app-service",
"jsonpath_lib",
"jsonpath_lib-fl",
"log",
"maplit",
"once_cell",

View File

@ -17,7 +17,7 @@ stepper-interface = { path = "../crates/stepper-interface" }
serde = { version = "1.0.116", features = [ "derive", "rc" ] }
serde_derive = "1.0.116"
jsonpath_lib = { git = "https://github.com/fluencelabs/jsonpath", branch = "fluence" }
jsonpath_lib-fl = "=0.2.6"
boolinator = "2.4.0"
log = "0.4.11"