Skip to content

Commit

Permalink
feat: add brew ci
Browse files Browse the repository at this point in the history
  • Loading branch information
Chronostasys committed Nov 11, 2022
1 parent 7813d01 commit 1f7411e
Show file tree
Hide file tree
Showing 3 changed files with 91 additions and 10 deletions.
93 changes: 86 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,24 @@ jobs:
runs-on: ${{ matrix.config.os }}
strategy:
fail-fast: false
max-parallel: 1
matrix:
config:
- os: "macOS-latest"
dir: osx64
arch: darwin-arm64
artifacts: "plc"
RUSTFLAGS: "-Dwarnings"
- os: "ubuntu-latest"
dir: linux64
debdir: pivot-lang_0.1.0-1_amd64
artifacts: "plc"
arch: linux-amd64
RUSTFLAGS: "-Dwarnings"
# - os: "windows-latest"
# dir: win64
# artifacts: "plc.exe"
# RUSTFLAGS: "-Dwarnings -Ctarget-feature=+crt-static"
- os: "macOS-latest"
dir: osx64
artifacts: "plc"
RUSTFLAGS: "-Dwarnings"
steps:
- uses: actions/checkout@v3
with:
Expand Down Expand Up @@ -220,7 +223,7 @@ jobs:
run: |
import os
src = os.environ['OUT_DIR']
dst = os.environ['OS'] + "-artifact.tar.gz"
dst = "pivot-lang-0.1.${{ github.run_number }}-${{ matrix.config.arch }}.tar.gz"
os.system("tar -czvf %s %s" % (dst, src))
shell: python
- name: Set outputs
Expand All @@ -229,8 +232,84 @@ jobs:
- uses: ncipollo/release-action@v1
name: upload
with:
artifacts: ${{ matrix.config.os }}-artifact.tar.gz
artifacts: "pivot-lang-0.1.${{ github.run_number }}-${{ matrix.config.arch }}.tar.gz"
allowUpdates: true
replacesArtifacts: false
commit: master
tag: cibuild-v${{ github.run_number }}@${{ steps.vars.outputs.sha_short }}
tag: v0.1.${{ github.run_number }}

- name: Release my project to my Homebrew tap
if: ${{ matrix.config.os == 'ubuntu-latest' }}
uses: Pivot-Studio/homebrew-releaser@main
with:
# The name of the homebrew tap to publish your formula to as it appears on GitHub.
# Required - strings.
homebrew_owner: Pivot-Studio
homebrew_tap: homebrew-tap

# The name of the folder in your homebrew tap where formula will be committed to.
# Default is shown - string.
# formula_folder: pivot-lang

# The GitHub Token (saved as a repo secret) that has `repo` permissions for the homebrew tap you want to release to.
# Required - string.
github_token: ${{ secrets.PAT }}

# Git author info used to commit to the homebrew tap.
# Defaults are shown - strings.
commit_owner: pivot-lang authors
commit_email: [email protected]

# Custom dependencies in case other formulas are needed to build the current one.
# Optional - multiline string.
depends_on: |
"llvm@14"
# Custom install command for your formula.
# Required - string.
install: |
lib.install Dir["./planglib"]
lib.install "./libvm.a"
bin.install "./plc"
# Custom test command for your formula so you can run `brew test`.
# Optional - string.
# test: 'assert_match("my script output", shell_output("my-script-command"))'

# Adds URL and checksum targets for different OS and architecture pairs. Using this option assumes
# a tar archive exists on your GitHub repo with the following URL pattern (this cannot be customized):
# https://github.com/{GITHUB_OWNER}/{REPO_NAME}/releases/download/{TAG}/{REPO_NAME}-{VERSION}-{OPERATING_SYSTEM}-{ARCHITECTURE}.tar.gz'
# Darwin AMD pre-existing path example: https://github.com/justintime50/myrepo/releases/download/v1.2.0/myrepo-1.2.0-darwin-amd64.tar.gz
# Linux ARM pre-existing path example: https://github.com/justintime50/myrepo/releases/download/v1.2.0/myrepo-1.2.0-linux-arm64.tar.gz
# Optional - booleans.
# target_darwin_amd64: true
target_darwin_arm64: true
# target_linux_amd64: true
# target_linux_arm64: false

# Update your homebrew tap's README with a table of all projects in the tap.
# This is done by pulling the information from all your formula.rb files - eg:
#
# | Project | Description | Install |
# | ------------------------------------------ | ------------ | ------------------------ |
# | [formula_1](https://github.com/user/repo1) | helpful text | `brew install formula_1` |
# | [formula_2](https://github.com/user/repo2) | helpful text | `brew install formula_2` |
# | [formula_3](https://github.com/user/repo3) | helpful text | `brew install formula_3` |
#
# Simply place the following in your README or wrap your project in these comment tags:
# <!-- project_table_start -->
# TABLE HERE
# <!--project_table_end -->
#
# Finally, mark `update_readme_table` as `true` in your GitHub Action config and we'll do the work of building a custom table for you.
# Default is `false` - boolean.
update_readme_table: true

# Skips committing the generated formula to a homebrew tap (useful for local testing).
# Default is shown - boolean.
skip_commit: false

# Logs debugging info to console.
# Default is shown - boolean.
debug: true
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ target
.VSCodeCounter
*.ll
*.out
*.sh

test.cpp
*.bc
.idea
Expand Down
6 changes: 4 additions & 2 deletions deb/DEBIAN/postinst
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@ NC='\033[0m'
RED='\033[0;31m'

if [ "$1" = configure ]; then
echo "export KAGARI_LIB_ROOT=/pl/planglib" >> ~/.bashrc
echo "export PL_ROOT=/pl" >> ~/.bashrc
if [[ -z "${KAGARI_LIB_ROOT}" ]]; then
echo "export KAGARI_LIB_ROOT=/pl/planglib" >> ~/.bashrc
echo "export PL_ROOT=/pl" >> ~/.bashrc
fi
echo "${GREEN}"
echo "-------------------------------------------------------------------"
echo "Successfully installed pivot-lang compiler with JIT feature!"
Expand Down

0 comments on commit 1f7411e

Please sign in to comment.