Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add automated release builds for tagged versions #11

Open
chase opened this issue May 14, 2023 · 4 comments
Open

Add automated release builds for tagged versions #11

chase opened this issue May 14, 2023 · 4 comments
Assignees
Labels
feature New feature or request

Comments

@chase
Copy link
Owner

chase commented May 14, 2023

Make sure that building for macOS actually produces an arm64 binary, not an x64 binary on the GitHub action runner.

@chase chase added the feature New feature or request label May 14, 2023
@chase chase self-assigned this May 14, 2023
@pataquets
Copy link

Bonus: interested people can use Github's "watch" feature to be notified of new releases (Watch->Custom->Releases)

@chase
Copy link
Owner Author

chase commented Feb 8, 2024

@noahlias I noticed your fork has basic CI setup, if it works well, would you like to make a PR?

@noahlias
Copy link

noahlias commented Feb 10, 2024

@noahlias I noticed your fork has basic CI setup, if it works well, would you like to make a PR?

It benefits from the recent release of github action container containing macos14, but my CI is too simple, if I want to distribute it, I probably need to set the dmg format, and also set the application icon, etc.

  • DMG distribute
  • APP Icon
  • Release version or some tag to trigger the workflow
  • or Linux build

It's my simple build.yaml. Since I am a fork's project, I must configure a personal access token

name: Build and Release

on:
  push:
    branches:
      - main

jobs:
  macos-build:
    runs-on: macos-14

    steps:
      - name: Checkout code
        uses: actions/checkout@v2

      - name: Setup CMake and Ninja
        uses: lukka/get-cmake@latest
        with:
            cmakeVersion: 3.25.2
            ninjaVersion: 1.11.1

      # https://github.com/actions/runner-images/blob/main/images/macos/macos-14-arm64-Readme.md
      - name: Build project
        run: |
          export DEVELOPER_DIR=/Applications/Xcode_14.3.1.app/Contents/Developer
          sudo xcode-select -s $DEVELOPER_DIR
          cmake -G "Ninja" -DCMAKE_BUILD_TYPE=Release -S . -B build
          cmake --build build

      - name: Create tarball
        run: tar czvf awirt.tar.gz -C build awrit/Release

      - name: Create GitHub Release
        id: create_release
        uses: actions/create-release@v1
        env:
          GITHUB_TOKEN: ${{ secrets.PAT }}
        with:
          tag_name: v0.1.2
          release_name: Release v0.1.2
          draft: false
          prerelease: false

      - name: Upload Release Asset
        uses: actions/upload-release-asset@v1
        env:
          GITHUB_TOKEN: ${{ secrets.PAT }}
        with:
          upload_url: ${{ steps.create_release.outputs.upload_url }}
          asset_path: ./awirt.tar.gz
          asset_name: awrit.tar.gz
          asset_content_type: application/gzip

I made it because it didn't work on M1 pro(the switch Xcode version didn't work), so I used actions to build it for my personal use.

@chase
Copy link
Owner Author

chase commented Feb 11, 2024

macOS releases are now built automatically and are available by using brew

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants