Release #9
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: Release | |
on: | |
workflow_dispatch: | |
inputs: | |
bump-type: | |
type: choice | |
required: true | |
options: | |
- patch | |
- minor | |
- major | |
env: | |
CLI_VERSION_FILE: Sources/XTreeKit/Common/Environment.swift | |
APP_XCCONFIG_FILE: XTree/XTree/Project.xcconfig | |
HOMEBREW_CASK_FILE: Casks/xtree.rb | |
permissions: | |
contents: write | |
discussions: write | |
jobs: | |
bump: | |
runs-on: macos-14 | |
steps: | |
# Checkout with custom token for pushin to protected branch | |
- uses: actions/checkout@v4 | |
with: | |
token: ${{ secrets.CUSTOM_GITHUB_TOKEN }} | |
- name: Select Xcode 15.3 | |
run: sudo xcode-select -s '/Applications/Xcode_15.3.app' | |
- run: brew install xcbeautify | |
# Update version in all files and commit | |
- name: Bump | |
run: | | |
NEW_VERSION=`ruby .github/scripts/bump.rb ${{ github.event.inputs.bump-type }}` | |
echo "NEW_VERSION=$NEW_VERSION" >> $GITHUB_ENV | |
- name: Build Release | |
run: | | |
make release-cli | |
make release-app | |
# Update sha, commit, add tag and push | |
- run: | | |
git config user.name "GitHub Actions" | |
git config user.email "swiftyfinch@yandex.com" | |
ruby .github/scripts/update_sha.rb Release/XTree.zip | |
- name: Git Commit and push | |
run: | | |
git commit --include ${{ env.CLI_VERSION_FILE }} \ | |
--include ${{ env.APP_XCCONFIG_FILE }} \ | |
--include ${{ env.HOMEBREW_CASK_FILE }} \ | |
--message "[skip ci] Bump version ${{ env.NEW_VERSION }}" | |
git push origin | |
- name: Release Draft | |
uses: softprops/action-gh-release@v2.0.2 | |
with: | |
name: 🌳 v${{ env.NEW_VERSION }} | |
draft: true | |
generate_release_notes: true | |
discussion_category_name: Releases | |
fail_on_unmatched_files: true | |
files: Release/*.zip | |
tag_name: ${{ env.NEW_VERSION }} |