From 2fbd9bac7f7b9e4170b4ac5bd3c22e674e06f9b1 Mon Sep 17 00:00:00 2001 From: Yorgos Saslis <2420882+gsaslis@users.noreply.github.com> Date: Sun, 9 Oct 2022 18:38:33 +0300 Subject: [PATCH 1/6] Adds new GitHub action that syncs with Radicle --- .github/workflows/main.yml | 46 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..9428b6b --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,46 @@ +name: Radicle Sync + +# Controls when the workflow will run +on: + push: + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + + steps: + + - name: Install radicle-cli + run: | + curl https://europe-west6-apt.pkg.dev/doc/repo-signing-key.gpg | sudo apt-key add - + echo deb https://europe-west6-apt.pkg.dev/projects/radicle-services radicle-cli main | sudo tee -a /etc/apt/sources.list.d/radicle-registry.list + sudo apt update + sudo apt install radicle-cli + + - name: Setup Radicle Identity + run: | + mkdir -p $HOME/.config/xyz.radicle.radicle-link/${{ secrets.RADICLE_IDENTITY_KEY_ID }}/keys + echo ${{ secrets.RADICLE_IDENTITY_PRIVATE_KEY }} | base64 --decode > $HOME/.config/xyz.radicle.radicle-link/${{ secrets.RADICLE_IDENTITY_KEY_ID }}/keys/librad.key + echo ${{ secrets.RADICLE_IDENTITY_PASSPHRASE }} | rad auth --name ${{ secrets.RADICLE_IDENTITY_NAME }} --stdin + + - name: Clone from Radicle + run: | + rad clone ${{ secrets.RADICLE_PROJECT_ID }} --no-confirm + cd ${{ secrets.RADICLE_PROJECT_NAME }} + + - name: Fetch code from GitHub + run: | + export GH_REPO_URL=$( echo ${{ github.repositoryUrl }} \ + | sed -e 's/git:\/\//git@/g' \ + | sed -e 's/github.com\//github.com:/g') + + git remote add github ${GH_REPO_URL} + git checkout -B ${{ github.ref }} --track github/${{ github.ref }} + + - name: Push to Radicle Network + run: | + rad push + From f70d035c77c9370453b837bb54af7d5a4bcff420 Mon Sep 17 00:00:00 2001 From: Yorgos Saslis <2420882+gsaslis@users.noreply.github.com> Date: Sun, 9 Oct 2022 18:42:07 +0300 Subject: [PATCH 2/6] authenticate without name --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 9428b6b..a788ec4 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -24,7 +24,7 @@ jobs: run: | mkdir -p $HOME/.config/xyz.radicle.radicle-link/${{ secrets.RADICLE_IDENTITY_KEY_ID }}/keys echo ${{ secrets.RADICLE_IDENTITY_PRIVATE_KEY }} | base64 --decode > $HOME/.config/xyz.radicle.radicle-link/${{ secrets.RADICLE_IDENTITY_KEY_ID }}/keys/librad.key - echo ${{ secrets.RADICLE_IDENTITY_PASSPHRASE }} | rad auth --name ${{ secrets.RADICLE_IDENTITY_NAME }} --stdin + echo ${{ secrets.RADICLE_IDENTITY_PASSPHRASE }} | rad auth --stdin - name: Clone from Radicle run: | From 709aab21636dcad23aaf9e09bc37239f45726bad Mon Sep 17 00:00:00 2001 From: Yorgos Saslis <2420882+gsaslis@users.noreply.github.com> Date: Sun, 9 Oct 2022 18:46:30 +0300 Subject: [PATCH 3/6] fixes `--passphrase` option became `--stdin` after 0.6.1 which is the released version --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index a788ec4..46f8e08 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -24,7 +24,7 @@ jobs: run: | mkdir -p $HOME/.config/xyz.radicle.radicle-link/${{ secrets.RADICLE_IDENTITY_KEY_ID }}/keys echo ${{ secrets.RADICLE_IDENTITY_PRIVATE_KEY }} | base64 --decode > $HOME/.config/xyz.radicle.radicle-link/${{ secrets.RADICLE_IDENTITY_KEY_ID }}/keys/librad.key - echo ${{ secrets.RADICLE_IDENTITY_PASSPHRASE }} | rad auth --stdin + echo ${{ secrets.RADICLE_IDENTITY_PASSPHRASE }} | rad auth --passphrase - name: Clone from Radicle run: | From 613131adbb54f197cbbbf48c211ccdc42bcbf825 Mon Sep 17 00:00:00 2001 From: Yorgos Saslis <2420882+gsaslis@users.noreply.github.com> Date: Sun, 9 Oct 2022 18:48:09 +0300 Subject: [PATCH 4/6] passphrase expects the phrase inline --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 46f8e08..8471a48 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -24,7 +24,7 @@ jobs: run: | mkdir -p $HOME/.config/xyz.radicle.radicle-link/${{ secrets.RADICLE_IDENTITY_KEY_ID }}/keys echo ${{ secrets.RADICLE_IDENTITY_PRIVATE_KEY }} | base64 --decode > $HOME/.config/xyz.radicle.radicle-link/${{ secrets.RADICLE_IDENTITY_KEY_ID }}/keys/librad.key - echo ${{ secrets.RADICLE_IDENTITY_PASSPHRASE }} | rad auth --passphrase + rad auth --passphrase ${{ secrets.RADICLE_IDENTITY_PASSPHRASE }} - name: Clone from Radicle run: | From b43b222de98379da91b2c5edbcf8f85ee1535232 Mon Sep 17 00:00:00 2001 From: Yorgos Saslis <2420882+gsaslis@users.noreply.github.com> Date: Mon, 10 Oct 2022 09:05:37 +0300 Subject: [PATCH 5/6] ensure --- .github/workflows/main.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 8471a48..acd20f2 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -19,6 +19,7 @@ jobs: echo deb https://europe-west6-apt.pkg.dev/projects/radicle-services radicle-cli main | sudo tee -a /etc/apt/sources.list.d/radicle-registry.list sudo apt update sudo apt install radicle-cli + rad --version - name: Setup Radicle Identity run: | From 9533d6bf129d2701b2ae736b64074dc1e46d08f7 Mon Sep 17 00:00:00 2001 From: Yorgos Saslis <2420882+gsaslis@users.noreply.github.com> Date: Mon, 10 Oct 2022 09:07:46 +0300 Subject: [PATCH 6/6] debug version info --- .github/workflows/main.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index acd20f2..87436af 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -20,6 +20,7 @@ jobs: sudo apt update sudo apt install radicle-cli rad --version + rad auth --help - name: Setup Radicle Identity run: |