Bump version to 0.1.6 #9
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*" | |
| permissions: | |
| contents: write | |
| jobs: | |
| build: | |
| strategy: | |
| matrix: | |
| include: | |
| - os: macos-14 | |
| target: aarch64-apple-darwin | |
| - os: macos-15 | |
| target: x86_64-apple-darwin | |
| - os: ubuntu-latest | |
| target: x86_64-unknown-linux-gnu | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| targets: ${{ matrix.target }} | |
| - name: Build | |
| run: cargo build --release --target ${{ matrix.target }} | |
| - name: Build hotkey helper | |
| if: runner.os == 'macOS' | |
| run: swiftc -O swift/main.swift -o calendarchy-hotkey | |
| - name: Package (macOS) | |
| if: runner.os == 'macOS' | |
| run: | | |
| cp calendarchy-hotkey target/${{ matrix.target }}/release/ | |
| cp LICENSE target/${{ matrix.target }}/release/ | |
| cd target/${{ matrix.target }}/release | |
| tar czf ../../../calendarchy-${{ matrix.target }}.tar.gz calendarchy calendarchy-hotkey LICENSE | |
| cd ../../.. | |
| - name: Package (Linux) | |
| if: runner.os == 'Linux' | |
| run: | | |
| cp LICENSE target/${{ matrix.target }}/release/ | |
| cd target/${{ matrix.target }}/release | |
| tar czf ../../../calendarchy-${{ matrix.target }}.tar.gz calendarchy LICENSE | |
| cd ../../.. | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: calendarchy-${{ matrix.target }} | |
| path: calendarchy-${{ matrix.target }}.tar.gz | |
| release: | |
| needs: build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Download artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| merge-multiple: true | |
| - name: Compute SHA256 hashes | |
| id: hashes | |
| run: | | |
| echo "arm64_sha256=$(sha256sum calendarchy-aarch64-apple-darwin.tar.gz | cut -d' ' -f1)" >> "$GITHUB_OUTPUT" | |
| echo "x86_64_sha256=$(sha256sum calendarchy-x86_64-apple-darwin.tar.gz | cut -d' ' -f1)" >> "$GITHUB_OUTPUT" | |
| echo "linux_x86_64_sha256=$(sha256sum calendarchy-x86_64-unknown-linux-gnu.tar.gz | cut -d' ' -f1)" >> "$GITHUB_OUTPUT" | |
| echo "source_sha256=$(curl -sL "https://github.com/sovanesyan/calendarchy/archive/${GITHUB_REF_NAME}.tar.gz" | sha256sum | cut -d' ' -f1)" >> "$GITHUB_OUTPUT" | |
| - name: Create GitHub Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| generate_release_notes: true | |
| files: | | |
| calendarchy-aarch64-apple-darwin.tar.gz | |
| calendarchy-x86_64-apple-darwin.tar.gz | |
| calendarchy-x86_64-unknown-linux-gnu.tar.gz | |
| - name: Update Homebrew formula | |
| env: | |
| TAP_TOKEN: ${{ secrets.HOMEBREW_TAP_TOKEN }} | |
| run: | | |
| VERSION="${GITHUB_REF_NAME#v}" | |
| ARM64_SHA="${{ steps.hashes.outputs.arm64_sha256 }}" | |
| X86_64_SHA="${{ steps.hashes.outputs.x86_64_sha256 }}" | |
| cat > /tmp/calendarchy.rb << FORMULA | |
| class Calendarchy < Formula | |
| desc "Terminal calendar app for Google Calendar and iCloud" | |
| homepage "https://github.com/sovanesyan/calendarchy" | |
| version "${VERSION}" | |
| license "MIT" | |
| on_macos do | |
| on_arm do | |
| url "https://github.com/sovanesyan/calendarchy/releases/download/v#{version}/calendarchy-aarch64-apple-darwin.tar.gz" | |
| sha256 "${ARM64_SHA}" | |
| end | |
| on_intel do | |
| url "https://github.com/sovanesyan/calendarchy/releases/download/v#{version}/calendarchy-x86_64-apple-darwin.tar.gz" | |
| sha256 "${X86_64_SHA}" | |
| end | |
| end | |
| def install | |
| bin.install "calendarchy" | |
| bin.install "calendarchy-hotkey" | |
| end | |
| test do | |
| assert_match version.to_s, shell_output("#{bin}/calendarchy --version") | |
| end | |
| end | |
| FORMULA | |
| git clone "https://x-access-token:${TAP_TOKEN}@github.com/sovanesyan/homebrew-calendarchy.git" /tmp/tap | |
| mkdir -p /tmp/tap/Formula | |
| cp /tmp/calendarchy.rb /tmp/tap/Formula/calendarchy.rb | |
| cd /tmp/tap | |
| git config user.name "github-actions[bot]" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| git add Formula/calendarchy.rb | |
| git commit -m "Update calendarchy to ${VERSION}" || exit 0 | |
| git push | |
| - name: Update AUR packages | |
| env: | |
| AUR_SSH_KEY: ${{ secrets.AUR_SSH_KEY }} | |
| run: | | |
| VERSION="${GITHUB_REF_NAME#v}" | |
| SOURCE_SHA="${{ steps.hashes.outputs.source_sha256 }}" | |
| LINUX_SHA="${{ steps.hashes.outputs.linux_x86_64_sha256 }}" | |
| mkdir -p ~/.ssh | |
| echo "$AUR_SSH_KEY" > ~/.ssh/aur | |
| chmod 600 ~/.ssh/aur | |
| printf 'Host aur.archlinux.org\n IdentityFile ~/.ssh/aur\n User aur\n' > ~/.ssh/config | |
| ssh-keyscan aur.archlinux.org >> ~/.ssh/known_hosts 2>/dev/null | |
| git config --global user.name "Serge Ovanesyan" | |
| git config --global user.email "sovanesyan@users.noreply.github.com" | |
| .github/scripts/update-aur.sh "$VERSION" "$SOURCE_SHA" "$LINUX_SHA" |