Skip to content

test: homebrew

test: homebrew #99

Workflow file for this run

name: Release
on:
push:
tags:
- "**"
workflow_dispatch: # Allows manual triggering
jobs:
release:
name: Release
runs-on: ubuntu-latest
permissions:
contents: write # required to create releases
steps:
- name: Clone repository
uses: actions/checkout@v3
- name: Install Zig
uses: mlugg/setup-zig@v2
with:
version: 0.14.1
- uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: libwayland-dev libx11-dev xorg-dev libegl-dev libxkbcommon-dev hfsprogs hfsplus hfsutils python3
version: 1.0
# - name: Upgrade
# run: |
# sudo apt update -y
# sudo apt upgrade -y
# sudo apt dist-upgrade
- name: Build executables
run: |
zig build -Dtarget=x86_64-windows -Doptimize=ReleaseSmall -Dexe_name=aztewoidz-${{github.ref_name}}-windows-x86 &&
zig build -Dtarget=x86_64-macos -Doptimize=ReleaseSmall -Dexe_name=aztewoidz-${{github.ref_name}}-darwin-x86 &&
zig build -Dtarget=aarch64-macos -Doptimize=ReleaseSmall -Dexe_name=aztewoidz-${{github.ref_name}}-darwin-aarch64 &&
zig build -Dtarget=x86_64-linux -Doptimize=ReleaseSmall -Dexe_name=aztewoidz-${{github.ref_name}}-linux-x86
- name: Create TAR files
run: |
cd ./zig-out/bin
mkdir darwin-amd64 && cp aztewoidz-${{github.ref_name}}-darwin-x86 darwin-amd64/aztewoidz
mkdir darwin-arm64 && cp aztewoidz-${{github.ref_name}}-darwin-aarch64 darwin-arm64/aztewoidz
mkdir linux-amd64 && cp aztewoidz-${{github.ref_name}}-linux-x86 linux-amd64/aztewoidz
tar -czvf aztewoidz-${{github.ref_name}}-darwin-amd64.tar.gz darwin-amd64/aztewoidz
tar -czvf aztewoidz-${{github.ref_name}}-darwin-arm64.tar.gz darwin-arm64/aztewoidz
tar -czvf aztewoidz-${{github.ref_name}}-linux-amd64.tar.gz linux-amd64/aztewoidz
- name: Generate Checksums
run: |
cd ./zig-out/bin
ls -al
sha256sum aztewoidz-* > checksums.txt
# - name: Generate DMG
# run: |
# dd if=/dev/zero of=/tmp/aztewoidz.dmg bs=1M count=16 status=progress
# mkfs.hfsplus -v "Aztewoidz Installer" /tmp/aztewoidz.dmg
# - name: Mount DMG
# run: |
# ls -la /etc/modprobe.d
# sudo mkdir -pv /mnt/tmp
# sudo mount -o loop /tmp/aztewoidz.dmg /mnt/tmp
# sudo cp -av ./zig-out/bin/aztewoidz_mac_arm /mnt/tmp
# sudo umount /mnt/tmp
- name: Release
# uses: softprops/action-gh-release@v2
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
./zig-out/bin/aztewoidz-${{github.ref_name}}-windows-x86.exe
./zig-out/bin/aztewoidz-${{github.ref_name}}-darwin-x86
./zig-out/bin/aztewoidz-${{github.ref_name}}-darwin-aarch64
./zig-out/bin/aztewoidz-${{github.ref_name}}-linux-x86
./zig-out/bin/aztewoidz-${{github.ref_name}}-darwin-amd64.tar.gz
./zig-out/bin/aztewoidz-${{github.ref_name}}-darwin-arm64.tar.gz
./zig-out/bin/aztewoidz-${{github.ref_name}}-linux-amd64.tar.gz
./zig-out/bin/checksums.txt
LICENSE
- name: Release project to Homebrew tap
uses: Justintime50/homebrew-releaser@v1
with:
# The name of the homebrew tap to publish your formula to as it appears on GitHub.
# Required - strings
homebrew_owner: aidanaden
homebrew_tap: homebrew-games
# The name of the folder in your homebrew tap where formula will be committed to.
# Default is shown - string
formula_folder: Formula
# The Personal Access Token (saved as a repo secret) that has `repo` permissions for the repo running the action AND Homebrew tap you want to release to.
# Required - string
github_token: ${{ secrets.HOMEBREW_ACCESS_TOKEN }}
# Git author info used to commit to the homebrew tap.
# Defaults are shown - strings
commit_owner: homebrew-releaser
commit_email: homebrew-releaser@example.com
# Install command for your formula.
# Required - string
install: 'bin.install "aztewoidz"'
# Test command for your formula, used for `brew test`.
# Optional - string
# test: 'assert_match("my script output", shell_output("my-script-command"))'
# Custom dependencies in case other formulas are needed to build the current one.
# Optional - multiline string
# depends_on: |
# "bash" => :build
# "gcc"
# Allows you to set a custom download strategy.
# NOTE: You'll need to implement the strategy and add it to your tap repository.
# Docs: https://docs.brew.sh/Formula-Cookbook#specifying-the-download-strategy-explicitly
# Optional - string
# download_strategy: CurlDownloadStrategy
# Allows you to add a custom `require_relative` at the top of the formula template.
# Optional - string
# custom_require: custom_download_strategy
# Allows you to add custom includes inside the formula class, before dependencies and install blocks.
# Optional - string
# formula_includes: 'include Language::Python::Virtualenv'
# Run 'brew update-python-resources' on the formula to add Python resources.
# Docs: https://docs.brew.sh/Python-for-Formula-Authors#python-declarations-for-applications
# Default is shown - boolean
# update_python_resources: true
# Override the automatically detected version of a formula with an explicit value.
# NOTE: This option should only be used if Homebrew cannot automatically detect the version when generating
# the Homebrew formula. Including this when not necessary could lead to uninstallable formula that may
# not pass `brew audit` due to mismatched or redundant version strings.
# Optional - string
# version: '1.2.0'
# 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` |
#
# Place the following in your README or wrap your project's table 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 shown - boolean
update_readme_table: true
# Skips committing the generated formula to a homebrew tap (useful to verify results on a first run).
# Default is shown - boolean
skip_commit: false
# Logs debugging info to console.
# Default is shown - boolean
debug: false