fix: make all block + allow optional, fix allow mode logic #79
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build & Release | |
on: | |
push: | |
branches: | |
- main | |
paths: | |
- Sources/**/* | |
- Package.* | |
# TODO previously would manually tag, | |
# tags: | |
# - v* # Push events to matching v*, i.e. v1.0, v20.15.10 | |
permissions: read-all | |
jobs: | |
build: | |
# TODO need ventura macos version https://github.com/actions/runner-images/issues/6426 to fix weird test issue | |
# https://github.com/actions/runner-images/issues/6642 | |
runs-on: macos-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Trunk Check | |
uses: trunk-io/trunk-action@v1 | |
with: | |
# without check-mode, only the diff is checked, but there is no delta | |
# when running within the context of a tag push | |
check-mode: all | |
# TODO is there a way to set swift version explicitly? | |
- name: setup Xcode version | |
run: | | |
ls /Applications | |
sudo xcode-select -s /Applications/Xcode_14.2.app | |
- name: Test | |
run: swift test -vv | |
- name: Conventional Changelog Action | |
id: changelog | |
uses: TriPSs/conventional-changelog-action@v4 | |
with: | |
github-token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} | |
skip-version-file: "true" | |
pre-commit: bin/pre-commit.js | |
- name: Build Release Binary | |
if: ${{ steps.changelog.outputs.skipped == 'false' }} | |
run: swift build -v -c release --arch arm64 --arch x86_64 | |
- name: Zip Release Binary | |
if: ${{ steps.changelog.outputs.skipped == 'false' }} | |
run: zip -rj hyper-focus.zip .build/apple/Products/Release/hyper-focus | |
- name: Release | |
if: ${{ steps.changelog.outputs.skipped == 'false' }} | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: hyper-focus.zip | |
# output options: https://github.com/TriPSs/conventional-changelog-action#outputs | |
body: ${{ steps.changelog.outputs.clean_changelog }} | |
tag_name: ${{ steps.changelog.outputs.tag }} | |
- name: Update Homebrew formula | |
uses: dawidd6/action-homebrew-bump-formula@v3 | |
with: | |
token: ${{secrets.PERSONAL_ACCESS_TOKEN}} | |
tap: iloveitaly/homebrew-tap | |
livecheck: true |