Skip to content

ci: don't build and release if no changelog entry was created, add br… #72

ci: don't build and release if no changelog entry was created, add br…

ci: don't build and release if no changelog entry was created, add br… #72

Workflow file for this run

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
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@v3
- 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
- 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: iloveitaly/conventional-changelog-action@1607ac70d5942487fb67e1d412d57868d8decca9
with:
github-token: ${{ secrets.github_token}}
skip-version-file: "true"
- 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.github_token}}
tap: iloveitaly/homebrew-tap
livecheck: true