-
-
Notifications
You must be signed in to change notification settings - Fork 2
75 lines (62 loc) · 2.27 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
name: Build & Release
on:
# allow manual runs for debugging purposes
workflow_dispatch: {}
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