Bump version from 1.0.0 to 1.0.3 #52
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: Prepare MacOS binaries for CLI release | |
on: | |
push: | |
branches: | |
- v2 # TODO remove after testings | |
- '**' | |
env: | |
# Name of the binary file that will be singed and uploaded | |
binaryFileName: jf | |
jobs: | |
# If the commit message contains 'Bump version from' | |
# extract the release version number and clear previous artifacts | |
Extract_Release_Version: | |
name: Extract Release Version | |
if: ${{ contains(github.event.head_commit.message, 'Bump version from') }} | |
runs-on: ubuntu-latest | |
outputs: | |
version: ${{ steps.extract_version.outputs.version }} | |
steps: | |
- name: Extract version | |
id: extract_version | |
run: | | |
VERSION=$(echo "${{ github.event.head_commit.message }}" | awk -F'to ' '{print $2}' | sed 's/[^0-9.]*//g') | |
echo "version=$VERSION" >> $GITHUB_OUTPUT | |
- name: Delete-Old-Artifacts | |
uses: kolpav/purge-artifacts-action@v1 | |
with: | |
token: ${{ secrets.JF_GIT_TOKEN }} | |
expire-in: 0 # Setting this to 0 will delete all artifacts | |
# Builds, signs, notarize and uploads the macOS binaries | |
prepareBinary: | |
name: Prepare-Binary | |
needs: Extract_Release_Version | |
runs-on: macos-latest | |
strategy: | |
matrix: | |
# goarch: [ arm64,amd64 ] | |
goarch: [ arm64 ] | |
steps: | |
- name: Set Environment Variable | |
run: | | |
echo "releaseVersion=${{ needs.Extract_Release_Version.outputs.version }}" >> $GITHUB_ENV | |
echo "goarch=${{ matrix.goarch }}" >> $GITHUB_ENV | |
# Setup | |
- name: Setup Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: 1.22.x | |
cache: false | |
# Build | |
- name: Checkout Source | |
uses: actions/checkout@v4 | |
# TODO uncomment this after tests | |
# with: | |
# ref: v2 | |
- name: Build | |
run: ./build/build.sh | |
- name: Sign & Notarize | |
env: | |
APPLE_CERT_DATA: ${{ secrets.APPLE_CERT_DATA }} | |
APPLE_CERT_PASSWORD: ${{ secrets.APPLE_CERT_PASSWORD }} | |
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }} | |
APPLE_ACCOUNT_ID: ${{ secrets.APPLE_ACCOUNT_ID }} | |
APPLE_APP_SPECIFIC_PASSWORD: ${{ secrets.APPLE_APP_SPECIFIC_PASSWORD }} | |
BINARY_FILE_NAME: ${{ env.binaryFileName }} | |
APP_TEMPLATE_PATH: ./build/jf.app | |
run: ./build/darwin-sign-and-notarize.sh | |
# Upload | |
- name: Upload Artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ env.binaryFileName }}-darwin-v${{ env.releaseVersion }}-${{ matrix.goarch }} | |
path: ./build/jf.app/Contents/MacOS/${{ env.binaryFileName }} | |
retention-days: 1 | |