ci: Add version file to binary release
This commit also upgrades deprecated actions.
This commit is contained in:
parent
d7c88f12ab
commit
54aacc9619
|
|
@ -22,9 +22,9 @@ jobs:
|
||||||
docker_options: -v /home/runner/work/heartwood/heartwood:/home/rust/src -v /home/runner/.cargo/git:/root/.cargo/git -v /home/runner/.cargo/registry:/root/.cargo/registry
|
docker_options: -v /home/runner/work/heartwood/heartwood:/home/rust/src -v /home/runner/.cargo/git:/root/.cargo/git -v /home/runner/.cargo/registry:/root/.cargo/registry
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout source code
|
- name: Checkout source code
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v4
|
||||||
- name: Configure build cache
|
- name: Configure build cache
|
||||||
uses: actions/cache@v3
|
uses: actions/cache@v4
|
||||||
with:
|
with:
|
||||||
path: |
|
path: |
|
||||||
~/.cargo/registry
|
~/.cargo/registry
|
||||||
|
|
@ -58,16 +58,16 @@ jobs:
|
||||||
- aarch64-apple-darwin
|
- aarch64-apple-darwin
|
||||||
- x86_64-apple-darwin
|
- x86_64-apple-darwin
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v4
|
||||||
- name: Configure build cache
|
- name: Configure build cache
|
||||||
uses: actions/cache@v3
|
uses: actions/cache@v4
|
||||||
with:
|
with:
|
||||||
path: |
|
path: |
|
||||||
~/.cargo/registry
|
~/.cargo/registry
|
||||||
~/.cargo/git
|
~/.cargo/git
|
||||||
target
|
target
|
||||||
key: cargo-${{ matrix.target }}-${{ hashFiles('**/Cargo.lock') }}
|
key: cargo-${{ matrix.target }}-${{ hashFiles('**/Cargo.lock') }}
|
||||||
- uses: dtolnay/rust-toolchain@1.67
|
- uses: dtolnay/rust-toolchain@stable
|
||||||
- name: Build the release binaries
|
- name: Build the release binaries
|
||||||
run: .github/workflows/build.bash "${{ matrix.target }}"
|
run: .github/workflows/build.bash "${{ matrix.target }}"
|
||||||
- name: Build the debug binaries
|
- name: Build the debug binaries
|
||||||
|
|
@ -80,7 +80,7 @@ jobs:
|
||||||
needs: [release-linux-binaries, release-macos-binaries]
|
needs: [release-linux-binaries, release-macos-binaries]
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-20.04
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v4
|
||||||
- run: .github/workflows/update-latest-symlink.bash "${{ github.sha }}"
|
- run: .github/workflows/update-latest-symlink.sh "${{ github.sha }}"
|
||||||
env:
|
env:
|
||||||
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
|
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
|
||||||
|
|
|
||||||
|
|
@ -1,19 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
|
|
||||||
set -o errexit
|
|
||||||
set -o nounset
|
|
||||||
set -o pipefail
|
|
||||||
|
|
||||||
main () {
|
|
||||||
if [[ $# -ne 1 ]]; then
|
|
||||||
echo "$#: Wrong number of arguments"
|
|
||||||
return 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
local sha=$1
|
|
||||||
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 ln -snf "/mnt/radicle/releases/${sha}" "/mnt/radicle/releases/latest"
|
|
||||||
}
|
|
||||||
|
|
||||||
main "$@"
|
|
||||||
|
|
@ -0,0 +1,27 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
set -o errexit
|
||||||
|
set -o nounset
|
||||||
|
|
||||||
|
remotely() {
|
||||||
|
ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -i ssh-private-key github-actions@files.radicle.xyz "$@"
|
||||||
|
}
|
||||||
|
|
||||||
|
main () {
|
||||||
|
if [ $# -ne 1 ]; then
|
||||||
|
echo "$#: Wrong number of arguments"
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
target="x86_64-unknown-linux-musl"
|
||||||
|
sha=$1
|
||||||
|
|
||||||
|
trap 'rm -f ssh-private-key' EXIT
|
||||||
|
|
||||||
|
echo "$SSH_PRIVATE_KEY" > ssh-private-key
|
||||||
|
chmod go-rwx ssh-private-key
|
||||||
|
|
||||||
|
remotely "/mnt/radicle/releases/${sha}/${target}/rad version --json > /mnt/radicle/releases/${sha}/version.json"
|
||||||
|
remotely ln -snf "/mnt/radicle/releases/${sha}" "/mnt/radicle/releases/latest"
|
||||||
|
}
|
||||||
|
|
||||||
|
main "$@"
|
||||||
Loading…
Reference in New Issue