From b33893741fa77f2ae258216feae665b1d3f7e3f0 Mon Sep 17 00:00:00 2001 From: Adam Szkoda Date: Mon, 3 Apr 2023 17:41:17 +0200 Subject: [PATCH] ci: Migrate away from Google Cloud Storage --- .github/workflows/release.yml | 47 +++++++++++++++-------------------- 1 file changed, 20 insertions(+), 27 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a690c77a..fdfde927 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -45,7 +45,7 @@ jobs: chmod --recursive go+r /root/.cargo/registry - shell: bash run: | - staging="${{ matrix.target }}" + staging="radicle-${{ matrix.target }}" mkdir -p "$staging" cp target/${{ matrix.target }}/release/radicle-httpd "$staging"/ cp target/${{ matrix.target }}/release/radicle-node "$staging"/ @@ -53,19 +53,15 @@ jobs: cp target/${{ matrix.target }}/release/git-remote-rad "$staging"/ tar czf "$staging.tar.gz" "$staging" cp "$staging.tar.gz" "$staging"/ - - id: 'auth' - uses: 'google-github-actions/auth@v1' - with: - workload_identity_provider: 'projects/281042598092/locations/global/workloadIdentityPools/github-actions/providers/google-cloud' - service_account: 'github-actions@radicle-services.iam.gserviceaccount.com' - - name: 'Set up Cloud SDK' - uses: 'google-github-actions/setup-gcloud@v1' - - id: 'upload-file' - uses: 'google-github-actions/upload-cloud-storage@v1' - with: - path: ${{ matrix.target }} - destination: heartwood-artifacts/${{ github.sha }}/ - + - shell: bash + run: | + echo "$SSH_PRIVATE_KEY" >ssh-private-key + chmod go-rwx ssh-private-key + ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -i ssh-private-key github-actions@files.radicle.xyz mkdir -p "/mnt/HC_Volume_30083854/releases/${{ matrix.target }}/${{ github.sha }}" + scp -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -i ssh-private-key -r radicle-${{ matrix.target }}/* "github-actions@files.radicle.xyz:/mnt/HC_Volume_30083854/releases/${{ matrix.target }}/${{ github.sha }}/" + ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -i ssh-private-key github-actions@files.radicle.xyz ln -snf "/mnt/HC_Volume_30083854/releases/${{ matrix.target }}/${{ github.sha }}" "/mnt/HC_Volume_30083854/releases/${{ matrix.target }}/latest" + env: + SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }} release-macos-binaries: permissions: @@ -97,7 +93,7 @@ jobs: cargo build --target ${{ matrix.target }} --bin git-remote-rad --release - shell: bash run: | - staging="${{ matrix.target }}" + staging="radicle-${{ matrix.target }}" mkdir -p "$staging" cp target/${{ matrix.target }}/release/radicle-httpd "$staging"/ cp target/${{ matrix.target }}/release/radicle-node "$staging"/ @@ -105,15 +101,12 @@ jobs: cp target/${{ matrix.target }}/release/git-remote-rad "$staging"/ tar czf "$staging.tar.gz" "$staging" cp "$staging.tar.gz" "$staging"/ - - id: 'auth' - uses: 'google-github-actions/auth@v1' - with: - workload_identity_provider: 'projects/281042598092/locations/global/workloadIdentityPools/github-actions/providers/google-cloud' - service_account: 'github-actions@radicle-services.iam.gserviceaccount.com' - - name: 'Set up Cloud SDK' - uses: 'google-github-actions/setup-gcloud@v1' - - id: 'upload-file' - uses: 'google-github-actions/upload-cloud-storage@v1' - with: - path: ${{ matrix.target }} - destination: heartwood-artifacts/${{ github.sha }} + - shell: bash + run: | + echo "$SSH_PRIVATE_KEY" >ssh-private-key + chmod go-rwx ssh-private-key + ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -i ssh-private-key github-actions@files.radicle.xyz mkdir -p "/mnt/HC_Volume_30083854/releases/${{ matrix.target }}/${{ github.sha }}" + scp -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -i ssh-private-key -r radicle-${{ matrix.target }}/* "github-actions@files.radicle.xyz:/mnt/HC_Volume_30083854/releases/${{ matrix.target }}/${{ github.sha }}/" + ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -i ssh-private-key github-actions@files.radicle.xyz ln -snf "/mnt/HC_Volume_30083854/releases/${{ matrix.target }}/${{ github.sha }}" "/mnt/HC_Volume_30083854/releases/${{ matrix.target }}/latest" + env: + SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}