Update Package-Registry [Testnet] #16
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: Update Package-Registry [Testnet] | |
on: | |
workflow_dispatch: | |
inputs: | |
revision: | |
description: 'Commit Hash (Defaults to last commit)' | |
required: false | |
jobs: | |
update-registry: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Configure SSH | |
uses: webfactory/[email protected] | |
with: | |
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }} | |
- name: Extract branch name | |
id: branch_name | |
run: echo "BRANCH_NAME=$(echo ${GITHUB_REF#refs/heads/})" >> $GITHUB_ENV | |
- name: Fetch source repository | |
uses: actions/checkout@v2 | |
with: | |
repository: ${{ github.repository }} | |
ref: ${{ env.BRANCH_NAME }} | |
path: source | |
- name: Fetch registry repository | |
run: | | |
git clone [email protected]:Origin-Byte/program-registry.git program-registry | |
- name: Setup dependencies | |
run: | | |
wget -qO stoml https://github.com/freshautomations/stoml/releases/download/v0.7.1/stoml_linux_amd64 | |
chmod +x stoml | |
source source/.env.dist | |
wget -qO sui_folder.tgz https://github.com/MystenLabs/sui/releases/download/${SUI_VERSION}/sui-${SUI_VERSION}-ubuntu-x86_64.tgz | |
tar -xzf sui_folder.tgz | |
cp target/release/sui-ubuntu-x86_64 sui | |
chmod +x sui | |
echo "installed" | |
- name: Build Packages | |
run: | | |
echo "Building packages" | |
cd source | |
./bin/build.sh remote | |
cd .. | |
- name: Copy registry to local fs | |
run: | | |
echo "Copying registry to local file system" | |
cp program-registry/registry-test.json registry-test.json | |
- name: Update local Package Registry | |
env: | |
REVISION: ${{ github.event.inputs.revision || github.sha }} | |
run: | | |
echo $(ls) | |
echo "Registering under revision: $REVISION" | |
./source/bin/register-all.sh ${{ github.repository }} $REVISION source remote registry-test.json | |
- name: Update remote registry | |
run: | | |
echo "Updating Test Package Registry" | |
cp registry-test.json program-registry/registry-test.json | |
cd program-registry | |
git add registry-test.json | |
git config user.name "OriginByte" | |
git config user.email "[email protected]" | |
git commit -m "Update Test Registry" | |
git push |