DEBUG: Try Node.js 20 like Creditcoin3 #35
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
/node-version: 18/node-version: 20/ | ||
--- | ||
/node-version: 18/node-version: 20/ | ||
name: Build Release Artifacts | ||
/node-version: 18/node-version: 20/ | ||
/node-version: 18/node-version: 20/ | ||
on: | ||
/node-version: 18/node-version: 20/ | ||
push: | ||
/node-version: 18/node-version: 20/ | ||
tags: | ||
/node-version: 18/node-version: 20/ | ||
- "*" | ||
/node-version: 18/node-version: 20/ | ||
/node-version: 18/node-version: 20/ | ||
permissions: read-all | ||
/node-version: 18/node-version: 20/ | ||
/node-version: 18/node-version: 20/ | ||
jobs: | ||
/node-version: 18/node-version: 20/ | ||
sanity-check: | ||
/node-version: 18/node-version: 20/ | ||
runs-on: ubuntu-22.04 | ||
/node-version: 18/node-version: 20/ | ||
steps: | ||
/node-version: 18/node-version: 20/ | ||
- uses: actions/checkout@v4 | ||
/node-version: 18/node-version: 20/ | ||
with: | ||
/node-version: 18/node-version: 20/ | ||
fetch-depth: 0 | ||
/node-version: 18/node-version: 20/ | ||
/node-version: 18/node-version: 20/ | ||
- name: Sanity check tag name | ||
/node-version: 18/node-version: 20/ | ||
run: | | ||
/node-version: 18/node-version: 20/ | ||
git describe --tag | grep -E "mainnet|testnet" | ||
/node-version: 18/node-version: 20/ | ||
/node-version: 18/node-version: 20/ | ||
build-native-runtime: | ||
/node-version: 18/node-version: 20/ | ||
needs: sanity-check | ||
/node-version: 18/node-version: 20/ | ||
strategy: | ||
/node-version: 18/node-version: 20/ | ||
fail-fast: false | ||
/node-version: 18/node-version: 20/ | ||
matrix: | ||
/node-version: 18/node-version: 20/ | ||
operating-system: [ubuntu-22.04, windows-2022, macos-11] | ||
/node-version: 18/node-version: 20/ | ||
runs-on: ${{ matrix.operating-system }} | ||
/node-version: 18/node-version: 20/ | ||
/node-version: 18/node-version: 20/ | ||
steps: | ||
/node-version: 18/node-version: 20/ | ||
- uses: actions/checkout@v4 | ||
/node-version: 18/node-version: 20/ | ||
with: | ||
/node-version: 18/node-version: 20/ | ||
fetch-depth: 0 | ||
/node-version: 18/node-version: 20/ | ||
/node-version: 18/node-version: 20/ | ||
- name: Set-up Linux | ||
/node-version: 18/node-version: 20/ | ||
if: matrix.operating-system == 'ubuntu-22.04' | ||
/node-version: 18/node-version: 20/ | ||
run: | | ||
/node-version: 18/node-version: 20/ | ||
sudo apt-get update | ||
/node-version: 18/node-version: 20/ | ||
sudo apt install -y cmake pkg-config libssl-dev git build-essential clang libclang-dev curl | ||
/node-version: 18/node-version: 20/ | ||
/node-version: 18/node-version: 20/ | ||
- name: Install protobuf | ||
/node-version: 18/node-version: 20/ | ||
uses: arduino/setup-protoc@v2 | ||
/node-version: 18/node-version: 20/ | ||
with: | ||
/node-version: 18/node-version: 20/ | ||
repo-token: ${{ secrets.GITHUB_TOKEN }} | ||
/node-version: 18/node-version: 20/ | ||
/node-version: 18/node-version: 20/ | ||
- name: Configure rustc version | ||
/node-version: 18/node-version: 20/ | ||
shell: bash | ||
/node-version: 18/node-version: 20/ | ||
run: | | ||
/node-version: 18/node-version: 20/ | ||
source ci/env | ||
/node-version: 18/node-version: 20/ | ||
echo "RUSTC_VERSION=$RUSTC_VERSION" >> "$GITHUB_ENV" | ||
/node-version: 18/node-version: 20/ | ||
/node-version: 18/node-version: 20/ | ||
- name: Install Rust toolchain | ||
/node-version: 18/node-version: 20/ | ||
uses: actions-rs/toolchain@v1 | ||
/node-version: 18/node-version: 20/ | ||
with: | ||
/node-version: 18/node-version: 20/ | ||
toolchain: ${{ env.RUSTC_VERSION }} | ||
/node-version: 18/node-version: 20/ | ||
target: wasm32-unknown-unknown | ||
/node-version: 18/node-version: 20/ | ||
profile: minimal | ||
/node-version: 18/node-version: 20/ | ||
override: true | ||
/node-version: 18/node-version: 20/ | ||
/node-version: 18/node-version: 20/ | ||
- name: Install MacOS aarch64 target | ||
/node-version: 18/node-version: 20/ | ||
if: matrix.operating-system == 'macos-11' | ||
/node-version: 18/node-version: 20/ | ||
uses: actions-rs/toolchain@v1 | ||
/node-version: 18/node-version: 20/ | ||
with: | ||
/node-version: 18/node-version: 20/ | ||
toolchain: ${{ env.RUSTC_VERSION }} | ||
/node-version: 18/node-version: 20/ | ||
target: aarch64-apple-darwin | ||
/node-version: 18/node-version: 20/ | ||
profile: minimal | ||
/node-version: 18/node-version: 20/ | ||
override: true | ||
/node-version: 18/node-version: 20/ | ||
/node-version: 18/node-version: 20/ | ||
- uses: Swatinem/rust-cache@v2 | ||
/node-version: 18/node-version: 20/ | ||
/node-version: 18/node-version: 20/ | ||
- name: Figure out platform | ||
/node-version: 18/node-version: 20/ | ||
shell: bash | ||
/node-version: 18/node-version: 20/ | ||
run: | | ||
/node-version: 18/node-version: 20/ | ||
PLATFORM=$(rustup target list --installed | grep "$(uname -m)") | ||
/node-version: 18/node-version: 20/ | ||
echo "PLATFORM=$PLATFORM" >> "$GITHUB_ENV" | ||
/node-version: 18/node-version: 20/ | ||
/node-version: 18/node-version: 20/ | ||
- name: Figure out tag name | ||
/node-version: 18/node-version: 20/ | ||
shell: bash | ||
/node-version: 18/node-version: 20/ | ||
run: | | ||
/node-version: 18/node-version: 20/ | ||
TAG_NAME=$(git describe --tag) | ||
/node-version: 18/node-version: 20/ | ||
echo "TAG_NAME=$TAG_NAME" >> "$GITHUB_ENV" | ||
/node-version: 18/node-version: 20/ | ||
/node-version: 18/node-version: 20/ | ||
- name: DEBUG | ||
/node-version: 18/node-version: 20/ | ||
shell: bash | ||
/node-version: 18/node-version: 20/ | ||
run: | | ||
/node-version: 18/node-version: 20/ | ||
echo "Tag & Platform is '${{ env.TAG_NAME }}-${{ env.PLATFORM }}'" | ||
/node-version: 18/node-version: 20/ | ||
/node-version: 18/node-version: 20/ | ||
- name: Build | ||
/node-version: 18/node-version: 20/ | ||
uses: actions-rs/cargo@v1 | ||
/node-version: 18/node-version: 20/ | ||
with: | ||
/node-version: 18/node-version: 20/ | ||
command: build | ||
/node-version: 18/node-version: 20/ | ||
args: --release | ||
/node-version: 18/node-version: 20/ | ||
/node-version: 18/node-version: 20/ | ||
- name: Build MacOS aarch64 target | ||
/node-version: 18/node-version: 20/ | ||
if: matrix.operating-system == 'macos-11' | ||
/node-version: 18/node-version: 20/ | ||
uses: actions-rs/cargo@v1 | ||
/node-version: 18/node-version: 20/ | ||
with: | ||
/node-version: 18/node-version: 20/ | ||
command: build | ||
/node-version: 18/node-version: 20/ | ||
args: --release --target aarch64-apple-darwin | ||
/node-version: 18/node-version: 20/ | ||
/node-version: 18/node-version: 20/ | ||
- name: Compress | ||
/node-version: 18/node-version: 20/ | ||
uses: thedoctor0/zip-release@0.7.6 | ||
/node-version: 18/node-version: 20/ | ||
with: | ||
/node-version: 18/node-version: 20/ | ||
type: "zip" | ||
/node-version: 18/node-version: 20/ | ||
directory: "target/release/" | ||
/node-version: 18/node-version: 20/ | ||
path: "creditcoin-node*" | ||
/node-version: 18/node-version: 20/ | ||
filename: "../../creditcoin-${{ env.TAG_NAME }}-${{ env.PLATFORM }}.zip" | ||
/node-version: 18/node-version: 20/ | ||
exclusions: "creditcoin-node.d" | ||
/node-version: 18/node-version: 20/ | ||
/node-version: 18/node-version: 20/ | ||
- name: Compress MacOS aarch64 target | ||
/node-version: 18/node-version: 20/ | ||
if: matrix.operating-system == 'macos-11' | ||
/node-version: 18/node-version: 20/ | ||
uses: thedoctor0/zip-release@0.7.6 | ||
/node-version: 18/node-version: 20/ | ||
with: | ||
/node-version: 18/node-version: 20/ | ||
type: "zip" | ||
/node-version: 18/node-version: 20/ | ||
directory: "target/aarch64-apple-darwin/release/" | ||
/node-version: 18/node-version: 20/ | ||
path: "creditcoin-node*" | ||
/node-version: 18/node-version: 20/ | ||
filename: "../../../creditcoin-${{ env.TAG_NAME }}-aarch64-apple-darwin.zip" | ||
/node-version: 18/node-version: 20/ | ||
exclusions: "creditcoin-node.d" | ||
/node-version: 18/node-version: 20/ | ||
/node-version: 18/node-version: 20/ | ||
- name: Upload binary | ||
/node-version: 18/node-version: 20/ | ||
uses: actions/upload-artifact@v4 | ||
/node-version: 18/node-version: 20/ | ||
with: | ||
/node-version: 18/node-version: 20/ | ||
path: "creditcoin-${{ env.TAG_NAME }}-*.zip" | ||
/node-version: 18/node-version: 20/ | ||
if-no-files-found: error | ||
/node-version: 18/node-version: 20/ | ||
/node-version: 18/node-version: 20/ | ||
build-wasm-runtime: | ||
/node-version: 18/node-version: 20/ | ||
needs: sanity-check | ||
/node-version: 18/node-version: 20/ | ||
runs-on: ubuntu-latest | ||
/node-version: 18/node-version: 20/ | ||
steps: | ||
/node-version: 18/node-version: 20/ | ||
- uses: actions/checkout@v4 | ||
/node-version: 18/node-version: 20/ | ||
with: | ||
/node-version: 18/node-version: 20/ | ||
fetch-depth: 0 | ||
/node-version: 18/node-version: 20/ | ||
/node-version: 18/node-version: 20/ | ||
- name: Figure out tag name | ||
/node-version: 18/node-version: 20/ | ||
shell: bash | ||
/node-version: 18/node-version: 20/ | ||
run: | | ||
/node-version: 18/node-version: 20/ | ||
TAG_NAME=$(git describe --tag) | ||
/node-version: 18/node-version: 20/ | ||
echo "TAG_NAME=$TAG_NAME" >> "$GITHUB_ENV" | ||
/node-version: 18/node-version: 20/ | ||
/node-version: 18/node-version: 20/ | ||
- name: Build WASM runtime | ||
/node-version: 18/node-version: 20/ | ||
id: srtool_build | ||
/node-version: 18/node-version: 20/ | ||
uses: chevdor/srtool-actions@v0.8.0 | ||
/node-version: 18/node-version: 20/ | ||
with: | ||
/node-version: 18/node-version: 20/ | ||
chain: "creditcoin" | ||
/node-version: 18/node-version: 20/ | ||
runtime_dir: runtime | ||
/node-version: 18/node-version: 20/ | ||
package: creditcoin-node-runtime | ||
/node-version: 18/node-version: 20/ | ||
tag: "1.66.1" # FIXME: remove this option (use the latest) once we're building w/ stable rust | ||
/node-version: 18/node-version: 20/ | ||
workdir: ${{ github.workspace }} | ||
/node-version: 18/node-version: 20/ | ||
/node-version: 18/node-version: 20/ | ||
- name: DEBUG | ||
/node-version: 18/node-version: 20/ | ||
run: | | ||
/node-version: 18/node-version: 20/ | ||
echo '${{ steps.srtool_build.outputs.json }}' | jq . > creditcoin-srtool-digest.json | ||
/node-version: 18/node-version: 20/ | ||
cat creditcoin-srtool-digest.json | ||
/node-version: 18/node-version: 20/ | ||
echo "Runtime location: ${{ steps.srtool_build.outputs.wasm }}" | ||
/node-version: 18/node-version: 20/ | ||
/node-version: 18/node-version: 20/ | ||
- name: Rename file | ||
/node-version: 18/node-version: 20/ | ||
run: | | ||
/node-version: 18/node-version: 20/ | ||
mv ${{ steps.srtool_build.outputs.wasm }} creditcoin-${{ env.TAG_NAME }}-runtime.wasm | ||
/node-version: 18/node-version: 20/ | ||
/node-version: 18/node-version: 20/ | ||
- name: Upload binary | ||
/node-version: 18/node-version: 20/ | ||
uses: actions/upload-artifact@v4 | ||
/node-version: 18/node-version: 20/ | ||
with: | ||
/node-version: 18/node-version: 20/ | ||
path: "*.wasm" | ||
/node-version: 18/node-version: 20/ | ||
if-no-files-found: error | ||
/node-version: 18/node-version: 20/ | ||
/node-version: 18/node-version: 20/ | ||
docker-build: | ||
/node-version: 18/node-version: 20/ | ||
needs: sanity-check | ||
/node-version: 18/node-version: 20/ | ||
runs-on: ubuntu-latest | ||
/node-version: 18/node-version: 20/ | ||
steps: | ||
/node-version: 18/node-version: 20/ | ||
- uses: actions/checkout@v4 | ||
/node-version: 18/node-version: 20/ | ||
with: | ||
/node-version: 18/node-version: 20/ | ||
fetch-depth: 0 | ||
/node-version: 18/node-version: 20/ | ||
/node-version: 18/node-version: 20/ | ||
- name: Figure out tag name | ||
/node-version: 18/node-version: 20/ | ||
shell: bash | ||
/node-version: 18/node-version: 20/ | ||
run: | | ||
/node-version: 18/node-version: 20/ | ||
TAG_NAME=$(git describe --tag) | ||
/node-version: 18/node-version: 20/ | ||
echo "TAG_NAME=$TAG_NAME" >> "$GITHUB_ENV" | ||
/node-version: 18/node-version: 20/ | ||
/node-version: 18/node-version: 20/ | ||
- name: Build docker image | ||
/node-version: 18/node-version: 20/ | ||
run: | | ||
/node-version: 18/node-version: 20/ | ||
docker build -t gluwa/creditcoin:${{ env.TAG_NAME }} . | ||
/node-version: 18/node-version: 20/ | ||
/node-version: 18/node-version: 20/ | ||
echo "${{ secrets.DOCKER_PUSH_PASSWORD }}" | docker login -u="${{ secrets.DOCKER_PUSH_USERNAME }}" --password-stdin | ||
/node-version: 18/node-version: 20/ | ||
docker push gluwa/creditcoin:${{ env.TAG_NAME }} | ||
/node-version: 18/node-version: 20/ | ||
/node-version: 18/node-version: 20/ | ||
# only -mainnet images are tagged as :latest | ||
/node-version: 18/node-version: 20/ | ||
# shellcheck disable=SC2046,SC2143 | ||
/node-version: 18/node-version: 20/ | ||
if [ $(echo "${{ env.TAG_NAME}}" | grep "mainnet") ]; then | ||
/node-version: 18/node-version: 20/ | ||
docker tag gluwa/creditcoin:${{ env.TAG_NAME }} gluwa/creditcoin:latest | ||
/node-version: 18/node-version: 20/ | ||
docker push gluwa/creditcoin:latest | ||
/node-version: 18/node-version: 20/ | ||
fi | ||
/node-version: 18/node-version: 20/ | ||
/node-version: 18/node-version: 20/ | ||
docker logout | ||
/node-version: 18/node-version: 20/ | ||
/node-version: 18/node-version: 20/ | ||
build-creditcoin-js: | ||
/node-version: 18/node-version: 20/ | ||
needs: sanity-check | ||
/node-version: 18/node-version: 20/ | ||
runs-on: ubuntu-latest | ||
/node-version: 18/node-version: 20/ | ||
steps: | ||
/node-version: 18/node-version: 20/ | ||
- uses: actions/checkout@v4 | ||
/node-version: 18/node-version: 20/ | ||
with: | ||
/node-version: 18/node-version: 20/ | ||
fetch-depth: 0 | ||
/node-version: 18/node-version: 20/ | ||
/node-version: 18/node-version: 20/ | ||
- name: Install Node.js | ||
/node-version: 18/node-version: 20/ | ||
uses: actions/setup-node@v4 | ||
/node-version: 18/node-version: 20/ | ||
with: | ||
/node-version: 18/node-version: 20/ | ||
node-version: 18 | ||
/node-version: 18/node-version: 20/ | ||
- run: npm install -g yarn | ||
/node-version: 18/node-version: 20/ | ||
/node-version: 18/node-version: 20/ | ||
- name: Figure out tag name | ||
/node-version: 18/node-version: 20/ | ||
shell: bash | ||
/node-version: 18/node-version: 20/ | ||
run: | | ||
/node-version: 18/node-version: 20/ | ||
TAG_NAME=$(git describe --tag) | ||
/node-version: 18/node-version: 20/ | ||
echo "TAG_NAME=$TAG_NAME" >> "$GITHUB_ENV" | ||
/node-version: 18/node-version: 20/ | ||
/node-version: 18/node-version: 20/ | ||
- name: Build creditcoin-js package | ||
/node-version: 18/node-version: 20/ | ||
run: | | ||
/node-version: 18/node-version: 20/ | ||
pushd creditcoin-js/ | ||
/node-version: 18/node-version: 20/ | ||
/node-version: 18/node-version: 20/ | ||
# version will match the git tag | ||
/node-version: 18/node-version: 20/ | ||
echo "DEBUG: Tag is '${{ env.TAG_NAME }}" | ||
/node-version: 18/node-version: 20/ | ||
sed -i 's/"version": ".*",/"version": "${{ env.TAG_NAME }}",/' package.json | ||
/node-version: 18/node-version: 20/ | ||
/node-version: 18/node-version: 20/ | ||
yarn install && yarn pack | ||
/node-version: 18/node-version: 20/ | ||
/node-version: 18/node-version: 20/ | ||
popd | ||
/node-version: 18/node-version: 20/ | ||
/node-version: 18/node-version: 20/ | ||
- name: Upload binary | ||
/node-version: 18/node-version: 20/ | ||
uses: actions/upload-artifact@v4 | ||
/node-version: 18/node-version: 20/ | ||
with: | ||
/node-version: 18/node-version: 20/ | ||
path: "creditcoin-js/creditcoin-js-v${{ env.TAG_NAME }}.tgz" | ||
/node-version: 18/node-version: 20/ | ||
if-no-files-found: error | ||
/node-version: 18/node-version: 20/ | ||
/node-version: 18/node-version: 20/ | ||
create-release: | ||
/node-version: 18/node-version: 20/ | ||
permissions: | ||
/node-version: 18/node-version: 20/ | ||
contents: write | ||
/node-version: 18/node-version: 20/ | ||
runs-on: ubuntu-latest | ||
/node-version: 18/node-version: 20/ | ||
needs: | ||
/node-version: 18/node-version: 20/ | ||
- build-native-runtime | ||
/node-version: 18/node-version: 20/ | ||
- build-wasm-runtime | ||
/node-version: 18/node-version: 20/ | ||
- build-creditcoin-js | ||
/node-version: 18/node-version: 20/ | ||
steps: | ||
/node-version: 18/node-version: 20/ | ||
- uses: actions/checkout@v4 | ||
/node-version: 18/node-version: 20/ | ||
with: | ||
/node-version: 18/node-version: 20/ | ||
fetch-depth: 0 | ||
/node-version: 18/node-version: 20/ | ||
/node-version: 18/node-version: 20/ | ||
- name: Figure out tag name | ||
/node-version: 18/node-version: 20/ | ||
shell: bash | ||
/node-version: 18/node-version: 20/ | ||
run: | | ||
/node-version: 18/node-version: 20/ | ||
TAG_NAME=$(git describe --tag) | ||
/node-version: 18/node-version: 20/ | ||
echo "TAG_NAME=$TAG_NAME" >> "$GITHUB_ENV" | ||
/node-version: 18/node-version: 20/ | ||
/node-version: 18/node-version: 20/ | ||
- name: Download binaries | ||
/node-version: 18/node-version: 20/ | ||
uses: actions/download-artifact@v4 | ||
/node-version: 18/node-version: 20/ | ||
/node-version: 18/node-version: 20/ | ||
- name: DEBUG | ||
/node-version: 18/node-version: 20/ | ||
shell: bash | ||
/node-version: 18/node-version: 20/ | ||
run: | | ||
/node-version: 18/node-version: 20/ | ||
ls -lR | ||
/node-version: 18/node-version: 20/ | ||
/node-version: 18/node-version: 20/ | ||
- name: Make the release | ||
/node-version: 18/node-version: 20/ | ||
uses: softprops/action-gh-release@v1 | ||
/node-version: 18/node-version: 20/ | ||
with: | ||
/node-version: 18/node-version: 20/ | ||
files: "artifact/creditcoin-*${{ env.TAG_NAME }}*" | ||
/node-version: 18/node-version: 20/ | ||
fail_on_unmatched_files: true | ||
/node-version: 18/node-version: 20/ | ||
name: ${{ env.TAG_NAME }} |