v2.0.0-alpha.29 #172
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: 'Publish a built Javascript Branch' | |
on: | |
push: | |
workflow_dispatch: | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
build: | |
name: Build Javascript | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: 'true' | |
- name: Install pcap | |
run: sudo apt-get install -y libpcap-dev | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 18 | |
cache: yarn | |
- name: Setup SSH for Git Operations | |
run: | | |
if [[ "$RUNNER_OS" == "Windows" ]]; then | |
SSH_PATH="$HOME/.ssh" | |
mkdir "$SSH_PATH" | |
echo "$SSH_PRIVATE_KEY" > "$SSH_PATH/id_rsa" | |
chmod 600 "$SSH_PATH/id_rsa" | |
ssh-keyscan github.com >> "$SSH_PATH/known_hosts" | |
else | |
SSH_PATH=~/.ssh | |
mkdir -p "$SSH_PATH" | |
echo "$SSH_PRIVATE_KEY" > "$SSH_PATH/id_rsa" | |
chmod 600 "$SSH_PATH/id_rsa" | |
ssh-keyscan github.com >> "$SSH_PATH/known_hosts" | |
fi | |
env: | |
SSH_PRIVATE_KEY: ${{ secrets.MAINCHAIN_SSH_KEY }} | |
- name: Clone Mainchain | |
run: | | |
export GIT_SSH_COMMAND="ssh -i $SSH_PATH/id_rsa -o UserKnownHostsFile=$SSH_PATH/known_hosts" | |
git clone -b napi-bindings [email protected]:ulixee/mainchain.git | |
working-directory: .. | |
- name: Install Mainchain | |
run: yarn | |
working-directory: ../mainchain | |
- name: Install Mainchain client | |
run: yarn tsc | |
working-directory: ../mainchain/client/nodejs | |
- name: Clone ulixee/shared | |
run: | | |
git clone -n https://github.com/ulixee/shared.git | |
cd shared | |
(git fetch --depth 1 origin $GITHUB_REF_NAME && git checkout $GITHUB_REF_NAME) || (git fetch --depth 1 origin main && git checkout main) | |
working-directory: .. | |
- name: Install ulixee/shared | |
run: yarn && yarn build | |
working-directory: ../shared | |
- name: Clone unblocked | |
run: | | |
git clone -n --recurse-submodules https://github.com/ulixee/unblocked.git | |
cd unblocked | |
(git fetch --depth 1 origin $GITHUB_REF_NAME && git checkout $GITHUB_REF_NAME) || (git fetch --depth 1 origin main && git checkout main) | |
git submodule update --init --recursive --depth 1 | |
working-directory: .. | |
- name: Install unblocked | |
run: yarn build | |
working-directory: ../unblocked | |
- name: Install Hero | |
run: yarn build | |
working-directory: ./hero | |
- name: Set timeout | |
run: yarn config set network-timeout 1000000 -g | |
- name: Build modules | |
run: yarn && yarn build:dist | |
- name: Publish branch | |
run: | | |
cd build-dist | |
git config --global user.email "[email protected]" | |
git config --global user.name "CI" | |
git init -b main | |
git add -A | |
git commit -m 'Auto-build Javascript files' | |
git push -f https://ulixee:${{ env.GH_TOKEN }}@github.com/ulixee/platform.git main:${{ github.ref_name }}-built-js | |
shell: bash | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |