Update github workflow scripts to use new binary downloads script

This commit is contained in:
Sean Darcy 2022-06-23 07:55:34 +10:00
parent 9f7ab361c9
commit eee77f3474
4 changed files with 94 additions and 96 deletions

View File

@ -5,6 +5,11 @@ on:
branches:
- master
- development
pull_request:
# The branches below must be a subset of the branches above
branches:
- master
- development
jobs:
build:
@ -17,6 +22,30 @@ jobs:
- name: Checkout git repo
uses: actions/checkout@v1
- name: Download macos oxend binaries
if: runner.os == 'macOS'
run: tools/download-oxen-files.sh https://oxen.rocks/oxen-io/oxen-core/oxen-stable-macos-LATEST.tar.xz
env:
OS: ${{ runner.os }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
shell: bash
- name: Download windows oxend binaries
if: runner.os == 'Windows'
run: tools/download-oxen-files.sh https://oxen.rocks/oxen-io/oxen-core/oxen-stable-windows-LATEST.zip
env:
OS: ${{ runner.os }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
shell: bash
- name: Download linux oxend binaries
if: runner.os == 'Linux'
run: tools/download-oxen-files.sh https://oxen.rocks/oxen-io/oxen-core/oxen-stable-linux-LATEST.tar.xz
env:
OS: ${{ runner.os }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
shell: bash
# Read node version from `.nvmrc` file
- name: Read nvm rc
id: nvmrc
@ -30,35 +59,6 @@ jobs:
- name: Install dependencies
run: npm install
- name: Download oxend binaries
run: ./download-release-bins.sh
env:
OS: ${{ runner.os }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
shell: bash
working-directory: ./downloads
- name: Extract zip binaries
if: runner.os == 'Windows'
run: unzip latest
shell: bash
working-directory: ./downloads
- name: Extract xz binaries
if: runner.os != 'Windows'
run: tar -xf latest
shell: bash
working-directory: ./downloads
- name: Move oxend binaries
run: |
find ./downloads -type f -name "oxend*" -exec cp '{}' ./bin \;
find ./downloads -type f -name "oxen-wallet-rpc*" -exec cp '{}' ./bin \;
shell: bash
- name: Verify binaries
run: ls ./bin
shell: bash
- name: Build window and linux binaries
if: runner.os != 'macOS'

View File

@ -16,6 +16,30 @@ jobs:
- name: Checkout git repo
uses: actions/checkout@v1
- name: Download macos oxend binaries
if: runner.os == 'macOS'
run: tools/download-oxen-files.sh https://oxen.rocks/oxen-io/oxen-core/oxen-dev-macos-LATEST.tar.xz
env:
OS: ${{ runner.os }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
shell: bash
- name: Download windows oxend binaries
if: runner.os == 'Windows'
run: tools/download-oxen-files.sh https://oxen.rocks/oxen-io/oxen-core/oxen-dev-windows-LATEST.zip
env:
OS: ${{ runner.os }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
shell: bash
- name: Download linux oxend binaries
if: runner.os == 'Linux'
run: tools/download-oxen-files.sh https://oxen.rocks/oxen-io/oxen-core/oxen-dev-linux-LATEST.tar.xz
env:
OS: ${{ runner.os }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
shell: bash
# Read node version from `.nvmrc` file
- name: Read nvm rc
id: nvmrc
@ -29,35 +53,6 @@ jobs:
- name: Install dependencies
run: npm install
- name: Download oxend binaries
run: ./download-dev-bins.sh
env:
OS: ${{ runner.os }}
shell: bash
working-directory: ./downloads
- name: Extract zip binaries
if: runner.os == 'Windows'
run: unzip latest
shell: bash
working-directory: ./downloads
- name: Extract xz binaries
if: runner.os != 'Windows'
run: tar -xf latest
shell: bash
working-directory: ./downloads
- name: Move oxend binaries
run: |
find ./downloads -type f -name "oxend*" -exec cp '{}' ./bin \;
find ./downloads -type f -name "oxen-wallet-rpc*" -exec cp '{}' ./bin \;
shell: bash
- name: Verify binaries
run: ls ./bin
shell: bash
- name: Build window and linux binaries
if: runner.os != 'macOS'
run: npm run build

View File

@ -16,6 +16,30 @@ jobs:
- name: Checkout git repo
uses: actions/checkout@v1
- name: Download macos oxend binaries
if: runner.os == 'macOS'
run: tools/download-oxen-files.sh https://oxen.rocks/oxen-io/oxen-core/oxen-stable-macos-LATEST.tar.xz
env:
OS: ${{ runner.os }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
shell: bash
- name: Download windows oxend binaries
if: runner.os == 'Windows'
run: tools/download-oxen-files.sh https://oxen.rocks/oxen-io/oxen-core/oxen-stable-windows-LATEST.zip
env:
OS: ${{ runner.os }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
shell: bash
- name: Download linux oxend binaries
if: runner.os == 'Linux'
run: tools/download-oxen-files.sh https://oxen.rocks/oxen-io/oxen-core/oxen-stable-linux-LATEST.tar.xz
env:
OS: ${{ runner.os }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
shell: bash
# Read node version from `.nvmrc` file
- name: Read nvm rc
id: nvmrc
@ -29,36 +53,6 @@ jobs:
- name: Install dependencies
run: npm install
- name: Download oxend binaries
run: ./download-release-bins.sh
env:
OS: ${{ runner.os }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
shell: bash
working-directory: ./downloads
- name: Extract zip binaries
if: runner.os == 'Windows'
run: unzip latest
shell: bash
working-directory: ./downloads
- name: Extract xz binaries
if: runner.os != 'Windows'
run: tar -xf latest
shell: bash
working-directory: ./downloads
- name: Move oxend binaries
run: |
find ./downloads -type f -name "oxend*" -exec cp '{}' ./bin \;
find ./downloads -type f -name "oxen-wallet-rpc*" -exec cp '{}' ./bin \;
shell: bash
- name: Verify binaries
run: ls ./bin
shell: bash
- name: Publish window and linux binaries
if: runner.os != 'macOS'
run: npm run release

View File

@ -3,14 +3,12 @@
if [ "$#" -ne 1 ] || [[ "$1" != http* ]]; then
cat <<EOF >&2
Usage: $0 URL -- download and extract an oxen-core build (typically from https://oxen.rocks)
Some common URLs:
https://oxen.rocks/oxen-io/oxen-core/oxen-stable-linux-LATEST.tar.xz
https://oxen.rocks/oxen-io/oxen-core/oxen-stable-win-LATEST.tar.xz
https://oxen.rocks/oxen-io/oxen-core/oxen-stable-win-LATEST.zip
https://oxen.rocks/oxen-io/oxen-core/oxen-stable-macos-LATEST.tar.xz
https://oxen.rocks/oxen-io/oxen-core/oxen-dev-linux-LATEST.tar.xz
https://oxen.rocks/oxen-io/oxen-core/oxen-dev-win-LATEST.tar.xz
https://oxen.rocks/oxen-io/oxen-core/oxen-dev-win-LATEST.zip
https://oxen.rocks/oxen-io/oxen-core/oxen-dev-macos-LATEST.tar.xz
EOF
exit 1
@ -33,8 +31,19 @@ fi
rm -f bin/oxen*
curl -sS "$1" | $tar --strip-components=1 -C bin -xJv --no-anchored oxend oxen-wallet-rpc
if [[ "$1" = *win*.zip ]]; then
tmpzip=$(mktemp XXXXXXXXXXXX.zip)
curl -sSo $tmpzip "$1"
unzip -p $tmpzip '*/oxend.exe' >bin/oxend.exe
unzip -p $tmpzip '*/oxen-wallet-rpc.exe' >bin/oxen-wallet-rpc.exe
rm -f $tmpzip
echo "Checking downloaded versions:"
echo -n "oxend: "; ./bin/oxend --version
echo -n "oxen-wallet-rpc: "; ./bin/oxen-wallet-rpc --version
echo "Extracted:"
ls -l bin/*.exe
else
curl -sS "$1" | $tar --strip-components=1 -C bin -xJv --no-anchored oxend oxen-wallet-rpc
echo "Checking downloaded versions:"
echo -n "oxend: "; ./bin/oxend --version
echo -n "oxen-wallet-rpc: "; ./bin/oxen-wallet-rpc --version
fi