Skip to content

Commit

Permalink
Merge pull request akiyosi#519 from akiyosi/macos-m1
Browse files Browse the repository at this point in the history
Add ci job on m1 mac
  • Loading branch information
akiyosi authored Feb 14, 2024
2 parents f559015 + 185ccf6 commit 7edadc7
Show file tree
Hide file tree
Showing 5 changed files with 211 additions and 45 deletions.
89 changes: 79 additions & 10 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -129,21 +129,18 @@ jobs:
# MacOS
#################################################################

test-and-build-macos:
test-and-build-macos-x86_64:
strategy:
matrix:
go-version: [1.21.x]
platform: [macos-latest]
platform: [macos-12]
runs-on: ${{ matrix.platform }}
env:
GOPATH: ${{ github.workspace }}
#QT_DIR: ${{ github.workspace }}/Qt
QT_HOMEBREW: true
QT_API: 5.13.0
QT_DEBUG: false
GO111MODULE: on
QMAKE_APPLE_DEVICE_ARCHS: arm64
# SDKROOT: /Library/Developer/CommandLineTools/SDKs/MacOSX11.1.sdk
steps:

- name: Install Go
Expand Down Expand Up @@ -174,7 +171,7 @@ jobs:
run: |
cd ${{ github.workspace }}/src/github.com/${{ github.repository }}
make deps
- name: Test
run: |
cd ${{ github.workspace }}/src/github.com/${{ github.repository }}
Expand All @@ -188,14 +185,86 @@ jobs:
- name: Archive
run: |
cd ${{ github.workspace }}/src/github.com/${{ github.repository }}/cmd/goneovim/deploy
mv darwin goneovim-macos
tar -jcvf goneovim-macos.tar.bz2 goneovim-macos
mv darwin goneovim-macos-x86_64
tar -jcvf goneovim-macos-x86_64.tar.bz2 goneovim-macos-x86_64
- name: Upload for macos
uses: actions/upload-artifact@v1
with:
name: goneovim-macos
path: ${{ github.workspace }}/src/github.com/${{ github.repository }}/cmd/goneovim/deploy/goneovim-macos.tar.bz2
name: goneovim-macos-x86_64
path: ${{ github.workspace }}/src/github.com/${{ github.repository }}/cmd/goneovim/deploy/goneovim-macos-x86_64.tar.bz2



#################################################################
# MacOS M1
#################################################################

test-and-build-macos-arm64:
strategy:
matrix:
go-version: [1.21.x]
platform: [macos-14]
runs-on: ${{ matrix.platform }}
env:
GOPATH: ${{ github.workspace }}
QT_HOMEBREW: true
QT_API: 5.13.0
QT_DEBUG: false
GO111MODULE: on
QT_QMAKE_DIR: /opt/homebrew/opt/qt@5/bin
steps:

- name: Install Go
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go-version }}

- name: Check Go Version
run: |
go version
- name: Install Qt for macOS
run: |
brew install qt@5
- name: Checkout code
uses: actions/checkout@v2
with:
fetch-depth: 0
path: ${{ env.GOPATH }}/src/github.com/${{ github.repository }}

- name: Get Qt binding for Go
run: |
cd ${{ github.workspace }}/src/github.com/${{ github.repository }}
make qt_bindings
- name: Get dependencies
run: |
cd ${{ github.workspace }}/src/github.com/${{ github.repository }}
make deps
- name: Test
run: |
cd ${{ github.workspace }}/src/github.com/${{ github.repository }}
make test
- name: Build
run: |
cd ${{ github.workspace }}/src/github.com/${{ github.repository }}
make app
- name: Archive
run: |
cd ${{ github.workspace }}/src/github.com/${{ github.repository }}/cmd/goneovim/deploy
mv darwin goneovim-macos-arm64
tar -jcvf goneovim-macos-arm64.tar.bz2 goneovim-macos-arm64
- name: Upload for macos m1
uses: actions/upload-artifact@v1
with:
name: goneovim-macos-arm64
path: ${{ github.workspace }}/src/github.com/${{ github.repository }}/cmd/goneovim/deploy/goneovim-macos-arm64.tar.bz2


#################################################################
Expand Down
102 changes: 90 additions & 12 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ jobs:
uses: actions/checkout@v2
with:
fetch-depth: 0
path: ./src/github.com/${{ github.repository }}
path: ${{ github.workspace }}/src/github.com/${{ github.repository }}

- name: Free disk space
run: |
Expand Down Expand Up @@ -158,23 +158,22 @@ jobs:


#################################################################
# MacOS
# MacOS x86_64
#################################################################

macos:
macos-x86_64:
needs: [check-new-commit]
strategy:
matrix:
go-version: [1.21.x]
platform: [macos-latest]
platform: [macos-12]
runs-on: ${{ matrix.platform }}
env:
GOPATH: ${{ github.workspace }}
QT_HOMEBREW: true
QT_API: 5.13.0
QT_DEBUG: false
GO111MODULE: on
QMAKE_APPLE_DEVICE_ARCHS: arm64
# SDKROOT: /Library/Developer/CommandLineTools/SDKs/MacOSX11.1.sdk
steps:

Expand All @@ -191,7 +190,7 @@ jobs:
uses: actions/checkout@v2
with:
fetch-depth: 0
path: ./src/github.com/${{ github.repository }}
path: ${{ github.workspace }}/src/github.com/${{ github.repository }}

- name: Get Qt binding for Go
run: |
Expand All @@ -216,11 +215,11 @@ jobs:
make app
- if: github.event_name == 'workflow_dispatch'
run: echo "ARCHIVE_NAME=goneovim-macos" >> $GITHUB_ENV
run: echo "ARCHIVE_NAME=goneovim-macos-x86_64" >> $GITHUB_ENV
- if: github.event_name == 'schedule'
run: echo "ARCHIVE_NAME=goneovim-macos" >> $GITHUB_ENV
run: echo "ARCHIVE_NAME=goneovim-macos-x86_64" >> $GITHUB_ENV
- if: github.event_name == 'push'
run: echo "ARCHIVE_NAME=goneovim-${{ steps.version-macos.outputs.GONEOVIM_VERSION }}-macos" >> $GITHUB_ENV
run: echo "ARCHIVE_NAME=goneovim-${{ steps.version-macos.outputs.GONEOVIM_VERSION }}-macos-x86_64" >> $GITHUB_ENV

- name: Archive
run: |
Expand All @@ -231,9 +230,88 @@ jobs:
- name: Upload for macos
uses: actions/upload-artifact@v1
with:
name: goneovim-macos
name: goneovim-macos-x86_64
path: ${{ github.workspace }}/src/github.com/${{ github.repository }}/cmd/goneovim/deploy/${{ env.ARCHIVE_NAME }}.tar.bz2


#################################################################
# MacOS M1
#################################################################

macos-arm64:
needs: [check-new-commit]
strategy:
matrix:
go-version: [1.21.x]
platform: [macos-14]
runs-on: ${{ matrix.platform }}
env:
GOPATH: ${{ github.workspace }}
QT_HOMEBREW: true
QT_API: 5.13.0
QT_DEBUG: false
GO111MODULE: on
QT_QMAKE_DIR: /opt/homebrew/opt/qt@5/bin
steps:

- name: Install Go
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go-version }}

- name: Install Qt for macOS
run: |
brew install qt@5
- name: Checkout code
uses: actions/checkout@v2
with:
fetch-depth: 0
path: ${{ github.workspace }}/src/github.com/${{ github.repository }}

- name: Get Qt binding for Go
run: |
cd ${{ github.workspace }}/src/github.com/${{ github.repository }}
make qt_bindings
- name: Get dependencies
run: |
cd ${{ github.workspace }}/src/github.com/${{ github.repository }}
make deps
- name: Retrieve version
id: version-macos
run: |
cd ${{ github.workspace }}/src/github.com/${{ github.repository }}
echo "::set-output name=GONEOVIM_VERSION::$(git describe --tags)"
echo "::set-output name=GONEOVIM_VERSION_HASH::$(git rev-parse HEAD)"
- name: Build
run: |
cd ${{ github.workspace }}/src/github.com/${{ github.repository }}
make app
- if: github.event_name == 'workflow_dispatch'
run: echo "ARCHIVE_NAME=goneovim-macos-arm64" >> $GITHUB_ENV
- if: github.event_name == 'schedule'
run: echo "ARCHIVE_NAME=goneovim-macos-arm64" >> $GITHUB_ENV
- if: github.event_name == 'push'
run: echo "ARCHIVE_NAME=goneovim-${{ steps.version-macos.outputs.GONEOVIM_VERSION }}-macos-arm64" >> $GITHUB_ENV

- name: Archive
run: |
cd ${{ github.workspace }}/src/github.com/${{ github.repository }}/cmd/goneovim/deploy
mv darwin "$ARCHIVE_NAME"
tar -jcvf "$ARCHIVE_NAME".tar.bz2 "$ARCHIVE_NAME"
- name: Upload for macos
uses: actions/upload-artifact@v1
with:
name: goneovim-macos-arm64
path: ${{ github.workspace }}/src/github.com/${{ github.repository }}/cmd/goneovim/deploy/${{ env.ARCHIVE_NAME }}.tar.bz2



#################################################################
# Windows
#################################################################
Expand Down Expand Up @@ -422,7 +500,7 @@ jobs:

publish:
# needs: [linux, windows, macos, freebsd]
needs: [linux, windows, macos]
needs: [linux, windows, macos-x86_64, macos-arm64]
runs-on: ubuntu-20.04
permissions:
contents: write
Expand Down Expand Up @@ -466,6 +544,6 @@ jobs:
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release create $TAG_NAME $PRERELEASE --title "$SUBJECT" --target $GITHUB_SHA /home/runner/work/goneovim/goneovim/goneovim-macos/* /home/runner/work/goneovim/goneovim/goneovim-linux/* /home/runner/work/goneovim/goneovim/goneovim-windows/*
gh release create $TAG_NAME $PRERELEASE --title "$SUBJECT" --target $GITHUB_SHA /home/runner/work/goneovim/goneovim/goneovim-macos-x86_64/* /home/runner/work/goneovim/goneovim/goneovim-macos-arm64/* /home/runner/work/goneovim/goneovim/goneovim-linux/* /home/runner/work/goneovim/goneovim/goneovim-windows/*
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,11 @@ endif


qt_bindings: ## Setup Qt bindings for Go.
@go get -v github.com/akiyosi/qt@v0.0.0-20230719061055-7747cdc680f3 && \
go get github.com/akiyosi/qt/internal/cmd@v0.0.0-20230719061055-7747cdc680f3 && \
@go get -v github.com/akiyosi/qt@v0.0.0-20240201144258-bb6c025d926e && \
go get github.com/akiyosi/qt/internal/cmd@v0.0.0-20240201144258-bb6c025d926e && \
go get github.com/akiyosi/qt/internal/binding/files/docs/5.12.0 && \
go get github.com/akiyosi/qt/internal/binding/files/docs/5.13.0 && \
go get github.com/akiyosi/qt/internal/cmd/moc@v0.0.0-20230719061055-7747cdc680f3 && \
go get github.com/akiyosi/qt/internal/cmd/moc@v0.0.0-20240201144258-bb6c025d926e && \
go install -v -tags=no_env github.com/akiyosi/qt/cmd/... && \
go mod vendor && \
$(GOQTSETUP) -test=false
Expand Down
19 changes: 10 additions & 9 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,27 +1,28 @@
module github.com/akiyosi/goneovim

go 1.20
go 1.21.4

require (
github.com/BurntSushi/toml v1.3.2
github.com/akiyosi/goqtframelesswindow v0.0.0-20230716140237-a341d42df3c8
github.com/akiyosi/qt v0.0.0-20230719061055-7747cdc680f3
github.com/akiyosi/qt v0.0.0-20240201144258-bb6c025d926e
github.com/akiyosi/short_path v0.2.1
github.com/atotto/clipboard v0.1.4
github.com/bluele/gcache v0.0.2
github.com/jessevdk/go-flags v1.5.0
github.com/mattn/go-isatty v0.0.19
github.com/mattn/go-isatty v0.0.20
github.com/mitchellh/go-homedir v1.1.0
github.com/neovim/go-client v1.2.2-0.20230716041012-dd77a916541b
)

require (
github.com/akiyosi/qt/internal/binding/files/docs/5.12.0 v0.0.0-20230719061055-7747cdc680f3 // indirect
github.com/akiyosi/qt/internal/binding/files/docs/5.13.0 v0.0.0-20230719061055-7747cdc680f3 // indirect
github.com/akiyosi/qt/internal/binding/files/docs/5.12.0 v0.0.0-20240201144258-bb6c025d926e // indirect
github.com/akiyosi/qt/internal/binding/files/docs/5.13.0 v0.0.0-20240201144258-bb6c025d926e // indirect
github.com/akiyosi/w32 v0.0.0-20221111133244-de73be0c7b36 // indirect
github.com/gopherjs/gopherjs v0.0.0-20190411002643-bd77b112433e // indirect
github.com/konsorten/go-windows-terminal-sequences v1.0.2 // indirect
github.com/sirupsen/logrus v1.4.1 // indirect
github.com/gopherjs/gopherjs v1.17.2 // indirect
github.com/sirupsen/logrus v1.8.1 // indirect
golang.org/x/mod v0.4.2 // indirect
golang.org/x/sys v0.6.0 // indirect
golang.org/x/tools v0.0.0-20190420181800-aa740d480789 // indirect
golang.org/x/tools v0.1.5 // indirect
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect
)
Loading

0 comments on commit 7edadc7

Please sign in to comment.