migrate format rules to AST, fix review findings in models and suppor… #2
Workflow file for this run
This file contains hidden or 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: | |
| push: | |
| tags: | |
| - 'v*' | |
| jobs: | |
| build: | |
| runs-on: macos-15 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Select Xcode version | |
| run: sudo xcode-select -s /Applications/Xcode_16.2.app/Contents/Developer | |
| - name: Build release binary | |
| run: swift build -c release --disable-sandbox | |
| - name: Create archive | |
| run: | | |
| mkdir -p dist | |
| cp .build/release/swiftiomatic dist/ | |
| cd dist && tar -czvf ../swiftiomatic-${{ github.ref_name }}-arm64.tar.gz * | |
| - name: Generate SHA256 | |
| run: shasum -a 256 swiftiomatic-${{ github.ref_name }}-arm64.tar.gz > swiftiomatic-${{ github.ref_name }}-arm64.tar.gz.sha256 | |
| - name: Generate release notes | |
| run: | | |
| PREV_TAG=$(git tag --sort=-v:refname | grep -E '^v[0-9]+\.[0-9]+\.[0-9]+$' | sed -n '2p') | |
| if [ -z "$PREV_TAG" ]; then | |
| NOTES=$(git log --pretty=format:"- %s" HEAD) | |
| else | |
| NOTES=$(git log --pretty=format:"- %s" ${PREV_TAG}..HEAD) | |
| fi | |
| echo "$NOTES" > release_notes.txt | |
| - name: Create GitHub Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| files: | | |
| swiftiomatic-${{ github.ref_name }}-arm64.tar.gz | |
| swiftiomatic-${{ github.ref_name }}-arm64.tar.gz.sha256 | |
| body_path: release_notes.txt | |
| update-homebrew: | |
| needs: build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Update Homebrew formula | |
| env: | |
| GH_TOKEN: ${{ secrets.HOMEBREW_TAP_TOKEN }} | |
| run: | | |
| TAG="${GITHUB_REF#refs/tags/}" | |
| VERSION="${TAG#v}" | |
| SHA=$(gh release download "$TAG" --repo "$GITHUB_REPOSITORY" --pattern "*.sha256" -O - | awk '{print $1}') | |
| git clone "https://x-access-token:${GH_TOKEN}@github.com/toba/homebrew-swiftiomatic.git" tap | |
| cd tap | |
| cat > Formula/swiftiomatic.rb << FORMULA | |
| class Swiftiomatic < Formula | |
| desc "AST-based Swift code analysis CLI — lint, format, and detect anti-patterns" | |
| homepage "https://github.com/toba/swiftiomatic" | |
| url "https://github.com/toba/swiftiomatic/releases/download/${TAG}/swiftiomatic-${TAG}-arm64.tar.gz" | |
| version "${VERSION}" | |
| sha256 "${SHA}" | |
| license "MIT" | |
| depends_on :macos => :sequoia | |
| depends_on arch: :arm64 | |
| def install | |
| bin.install "swiftiomatic" | |
| end | |
| test do | |
| assert_match "swiftiomatic", shell_output("#{bin}/swiftiomatic --help") | |
| end | |
| end | |
| FORMULA | |
| sed -i 's/^ //' Formula/swiftiomatic.rb | |
| git config user.name "github-actions[bot]" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| git add Formula/swiftiomatic.rb | |
| git commit -m "bump to ${VERSION}" | |
| git push |