Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix autobuild #12

Merged
merged 2 commits into from
Jan 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
67 changes: 67 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: Create Release

on:
push:
tags:
- 'v*' # Trigger when a commit is tagged with a new version. TODO: Use a filter pattern for major releases only.

jobs:
create_release:
name: Create Release
runs-on: ubuntu-latest
steps:
- name: Create Release
id: create_release
uses: softprops/action-gh-release@v1
with:
name: ${{ github.ref_name }}
draft: false
prerelease: false
generate_release_notes: true

build_release:
name: Build Release
needs: create_release
runs-on: ${{ matrix.os }}
strategy:
matrix:
name: [
linux,
macos
]

include:
- name: linux
os: ubuntu-latest
artifact_path: target/release/phoenix-cli
asset_name: phoenix-cli-linux
- name: macos
os: macos-latest
artifact_path: target/release/phoenix-cli
asset_name: phoenix-cli-macos
steps:
- name: Checkout code
uses: actions/checkout@v1

- name: Use Rust toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable

- name: Build
run: cargo build --release --locked

- name: Rename executable based on OS
env:
ASSET_NAME: ${{matrix.asset_name}}
EXEC_PATH: ${{matrix.artifact_path}}
run: |
echo "asset name: ${ASSET_NAME} executable path: ${EXEC_PATH}"
mv ${EXEC_PATH} ${ASSET_NAME}

- name: Upload binaries to release
uses: softprops/action-gh-release@v1
with:
files: ${{matrix.asset_name}}
fail_on_unmatched_files: true
17 changes: 10 additions & 7 deletions phoenix-cli-install.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,18 @@ case "$PROCESSOR" in
esac

BIN="phoenix-cli"
VERSION="0.1.0-x86_64-unknown-linux-gnu"
SUFFIX="linux"

if [ "$OS_FLAVOUR" = Darwin ]; then
SUFFIX="macos"
fi

VERSION="0.1.0-x86_64-apple-darwin"

if ["$OS_FLAVOUR" = Windows ]; then
echo "Windows is not currently supported using this installer."
exit 1
fi

DIST="$VERSION"
DIST="verifier-cli-$SUFFIX"

# creates a temporary directory to save the distribution file
SOURCE="$(mktemp -d)"
Expand All @@ -58,9 +61,9 @@ echo "$(CYN "1.") 🖥 $(CYN "Downloading distribution")"
echo ""

# downloads the distribution file
REMOTE="https://github.com/Ellipsis-Labs/phoenix-cli/releases/download/v0.1.0/"
echo " => downloading from: $(CYN $REMOTE$BIN"-"$DIST)"
curl -L $REMOTE$BIN"-"$DIST --output "$SOURCE/$DIST"
REMOTE="https://github.com/Ellipsis-Labs/phoenix-cli/releases/latest/download/"
echo " => downloading from: $(CYN $REMOTE$DIST)"
curl -L $REMOTE$DIST --output "$SOURCE/$DIST"
abort_on_error $?

SIZE=$(wc -c "$SOURCE/$DIST" | grep -oE "[0-9]+" | head -n 1)
Expand Down