-
-
Notifications
You must be signed in to change notification settings - Fork 151
CI polishing, add win64, update macOS min version #578
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
Merged
Merged
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
3225612
uniform `test.yml` to `release.yml`
umbynos af427c5
added again https://github.com/arduino/arduino-create-agent/pull/561 …
umbynos 988edd2
apply corrections from code review
umbynos 33752ee
apply correction also to `release.yml`
umbynos c193242
add win64 build in and refactor taskfile
umbynos 3e532a0
change min supported macOS version to 10.11 (also go 1.14)
umbynos 0e658b3
hard-code gon config in a step for uniformity and ease
umbynos 4a9b413
add tasks to build with fixed tags (💩) useful in `test.yml`
umbynos 069598d
refactor and optimize Taskfile (✨) change also workflows accordingly
umbynos 2a3e6f1
revert install rsrc in a separate step: should solve not found in PATH
umbynos d9bcad4
reintroduced .exe win extension
umbynos 8025736
add another win CI matrix to build win 32-64
umbynos ace6600
fix weird behavior
umbynos 251cb51
fix wrong conditions 🧒
umbynos bf32db6
uniform `release` to `test` workflow
umbynos a26b42b
add win 32/64 to all the jobs in the release workflow & optimizations 🧙🏻
umbynos 49a2a3f
fix "
umbynos File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,9 +10,17 @@ jobs: | |
build: | ||
strategy: | ||
matrix: | ||
operating-system: [ubuntu-18.04, windows-2019, macos-10.15] | ||
include: | ||
- operating-system: ubuntu-18.04 | ||
- operating-system: windows-2019 | ||
arch: -386 | ||
- operating-system: windows-2019 | ||
arch: -amd64 | ||
- operating-system: macos-10.15 | ||
|
||
runs-on: ${{ matrix.operating-system }} | ||
env: | ||
TAG_VERSION: ${GITHUB_REF##*/} # will be available to all steps and will be used by task build | ||
|
||
steps: | ||
- name: Disable EOL conversions | ||
|
@@ -24,7 +32,7 @@ jobs: | |
- name: Install Go | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: "1.15" | ||
go-version: "1.14" | ||
|
||
# dependencies used for compiling the GUI | ||
- name: Install Dependencies (Linux) | ||
|
@@ -53,7 +61,7 @@ jobs: | |
run: task test-unit | ||
|
||
- name: Build the Agent for linux | ||
run: task build | ||
run: task build | ||
if: matrix.operating-system == 'ubuntu-18.04' | ||
|
||
# build the agent without GUI support (no tray icon) | ||
|
@@ -62,32 +70,36 @@ jobs: | |
if: matrix.operating-system == 'ubuntu-18.04' | ||
|
||
# the manifest is required by windows GUI apps, otherwise the binary will crash with: "Unable to create main window: TTM_ADDTOOL failed" (for reference https://github.com/lxn/walk/issues/28) | ||
# rsrc will produce *.syso files that should get automatically recognized by go build command and linked into an executable. | ||
- name: Embed manifest in win binary | ||
run: | | ||
go get github.com/akavel/rsrc | ||
rsrc -arch 386 -manifest manifest.xml | ||
# rsrc will produce a *.syso file that should get automatically recognized by go build command and linked into an executable. | ||
- name: Download tool to embed manifest in win binary | ||
run: go get github.com/akavel/rsrc | ||
if: matrix.operating-system == 'windows-2019' | ||
|
||
# building the agent for win requires a different task because of an extra flag | ||
- name: Build the Agent for win32 | ||
env: | ||
GOARCH: 386 # 32bit architecture (for support) | ||
GO386: 387 # support old instruction sets without MMX (used in the Pentium 4) (will be deprecated in GO > 1.15 https://golang.org/doc/go1.15) | ||
run: task build-win32 | ||
if: matrix.operating-system == 'windows-2019' | ||
run: task build-win | ||
if: matrix.operating-system == 'windows-2019' && matrix.arch == '-386' | ||
|
||
- name: Build the Agent for win64 | ||
run: task build-win # GOARCH=amd64 by default on the runners | ||
if: matrix.operating-system == 'windows-2019' && matrix.arch == '-amd64' | ||
|
||
- name: Build the Agent for macos | ||
env: | ||
MACOSX_DEPLOYMENT_TARGET: 10.9 # minimum supported version for mac | ||
MACOSX_DEPLOYMENT_TARGET: 10.11 # minimum supported version for mac | ||
CGO_CFLAGS: -mmacosx-version-min=10.11 | ||
CGO_LDFLAGS: -mmacosx-version-min=10.11 | ||
run: task build | ||
if: matrix.operating-system == 'macos-10.15' | ||
|
||
# config.ini is required by the executable when it's run | ||
- name: Upload artifacts | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: arduino-create-agent-${{ matrix.operating-system }} | ||
name: arduino-create-agent-${{ matrix.operating-system }}${{ matrix.arch }} | ||
path: | | ||
arduino-create-agent* | ||
config.ini | ||
|
@@ -101,12 +113,6 @@ jobs: | |
RUNS_ON: macos-10.15 # used to parametrize filenames | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
with: | ||
repository: 'bcmi-labs/arduino-create-agent-installer' # the repo which contains gon.config.hcl | ||
token: ${{ secrets.ARDUINO_CREATE_AGENT_CI_PAT }} | ||
|
||
- name: Download artifact | ||
uses: actions/download-artifact@v2 | ||
with: | ||
|
@@ -130,14 +136,29 @@ jobs: | |
wget -q https://github.com/mitchellh/gon/releases/download/v0.2.3/gon_macos.zip | ||
unzip gon_macos.zip -d /usr/local/bin | ||
|
||
- name: Write gon config to file | ||
# gon does not allow env variables in config file (https://github.com/mitchellh/gon/issues/20) | ||
run: | | ||
cat > gon.config.hcl <<EOF | ||
source = ["arduino-create-agent-${{ env.RUNS_ON }}/arduino-create-agent"] | ||
bundle_id = "cc.arduino.arduino-agent" | ||
sign { | ||
application_identity = "Developer ID Application: ARDUINO SA (7KT7ZWMCJT)" | ||
} | ||
# Ask Gon for zip output to force notarization process to take place. | ||
# The CI will ignore the zip output, using the signed binary only. | ||
zip { | ||
output_path = "arduino-create-agent.zip" | ||
} | ||
EOF | ||
|
||
Comment on lines
+139
to
+154
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is a really simple and effective mechanism for templating config files, kudos! |
||
- name: Code sign and notarize app | ||
env: | ||
AC_USERNAME: ${{ secrets.AC_USERNAME }} | ||
AC_PASSWORD: ${{ secrets.AC_PASSWORD }} | ||
run: | | ||
echo "gon will notarize executable in arduino-create-agent-${{ env.RUNS_ON }}/arduino-create-agent" | ||
gon -log-level=debug -log-json gon.config.hcl | ||
# gon will notarize executable in "arduino-create-agent-${{ env.RUNS_ON }}/arduino-create-agent | ||
# The CI will ignore the zip output, using the signed binary only. | ||
timeout-minutes: 30 | ||
|
||
# This step will overwrite the non signed mac artifact (arduino-create-agent-${{ env.RUNS_ON }}) | ||
|
@@ -171,13 +192,20 @@ jobs: | |
strategy: | ||
fail-fast: false # if one os is failing continue nonetheless | ||
matrix: # used to generate installers for different OS and not for runs-on | ||
operating-system: [ubuntu-18.04, windows-2019, macos-10.15] | ||
|
||
include: | ||
- operating-system: ubuntu-18.04 | ||
install-builder-name: linux-x64 | ||
executable-path: artifacts/linux-amd64/ | ||
- operating-system: windows-2019 | ||
arch: -386 | ||
browser: edge | ||
install-builder-name: windows | ||
executable-path: artifacts/windows/ | ||
extension: .exe | ||
installer-extension: .exe | ||
- operating-system: windows-2019 | ||
arch: -amd64 | ||
browser: edge | ||
install-builder-name: windows | ||
executable-path: artifacts/windows/ | ||
|
@@ -213,7 +241,7 @@ jobs: | |
- name: Download artifact | ||
uses: actions/download-artifact@v2 | ||
with: | ||
name: arduino-create-agent-${{ matrix.operating-system }} | ||
name: arduino-create-agent-${{ matrix.operating-system }}${{ matrix.arch }} | ||
path: ${{ matrix.executable-path }} # path expected by installbuilder | ||
|
||
# zip artifacts do not mantain executable permission | ||
|
@@ -244,10 +272,10 @@ jobs: | |
- name: Launch Bitrock installbuilder-20 with CERT_INSTALL && CHOICE_CERT_INSTALL | ||
run: | | ||
${{ env.INSTALLBUILDER_PATH }} build installer.xml ${{ matrix.install-builder-name }} --verbose --license /tmp/license.xml --setvars ${INSTALLER_VARS} ${{ env.CERT_INSTALL }} | ||
mv -v ArduinoCreateAgent-${VERSION%.*}-${{ matrix.install-builder-name }}-installer-CI${{matrix.installer-extension}} ArduinoCreateAgent-${VERSION%.*}-${{ matrix.install-builder-name }}-installer-${{matrix.browser}}${{matrix.installer-extension}} | ||
mv -v ArduinoCreateAgent-${VERSION%.*}-${{ matrix.install-builder-name }}-installer-CI${{matrix.installer-extension}} ArduinoCreateAgent-${VERSION%.*}-${{ matrix.install-builder-name }}${{ matrix.arch }}-installer-${{matrix.browser}}${{matrix.installer-extension}} | ||
${{ env.INSTALLBUILDER_PATH }} build installer.xml ${{ matrix.install-builder-name }} --verbose --license /tmp/license.xml --setvars ${INSTALLER_VARS} ${{ env.CHOICE_CERT_INSTALL }} | ||
cp -vr ArduinoCreateAgent-${VERSION%.*}-${{ matrix.install-builder-name }}-installer-CC${{matrix.installer-extension}} ArduinoCreateAgent-${VERSION%.*}-${{ matrix.install-builder-name }}-installer-chrome${{matrix.installer-extension}} | ||
mv -v ArduinoCreateAgent-${VERSION%.*}-${{ matrix.install-builder-name }}-installer-CC${{matrix.installer-extension}} ArduinoCreateAgent-${VERSION%.*}-${{ matrix.install-builder-name }}-installer-firefox${{matrix.installer-extension}} | ||
cp -vr ArduinoCreateAgent-${VERSION%.*}-${{ matrix.install-builder-name }}-installer-CC${{matrix.installer-extension}} ArduinoCreateAgent-${VERSION%.*}-${{ matrix.install-builder-name }}${{ matrix.arch }}-installer-chrome${{matrix.installer-extension}} | ||
mv -v ArduinoCreateAgent-${VERSION%.*}-${{ matrix.install-builder-name }}-installer-CC${{matrix.installer-extension}} ArduinoCreateAgent-${VERSION%.*}-${{ matrix.install-builder-name }}${{ matrix.arch }}-installer-firefox${{matrix.installer-extension}} | ||
rm -r ArduinoCreateAgent-${VERSION%.*}-${{ matrix.install-builder-name }}-installer-C* | ||
if: matrix.operating-system == 'windows-2019' || matrix.operating-system == 'macos-10.15' | ||
|
||
|
@@ -264,7 +292,7 @@ jobs: | |
- name: Upload artifacts | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: ArduinoCreateAgent-${{ matrix.install-builder-name }} | ||
name: ArduinoCreateAgent-${{ matrix.install-builder-name }}${{ matrix.arch }} | ||
path: ArduinoCreateAgent* | ||
if-no-files-found: error | ||
|
||
|
@@ -378,7 +406,7 @@ jobs: | |
mv -v ArduinoCreateAgent-linux-x64/* release/ | ||
cat ArduinoCreateAgent-osx/*.tar | tar -xvf - -i -C release/ | ||
rm -v release/._ArduinoCreateAgent*.dmg | ||
mv -v ArduinoCreateAgent-windows/* release/ | ||
mv -v ArduinoCreateAgent-windows*/* release/ | ||
|
||
- name: Create Github Release | ||
uses: actions/create-release@v1 | ||
|
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,32 @@ | ||
version: "2" | ||
version: '3' | ||
|
||
tasks: | ||
|
||
build: | ||
desc: Build the project | ||
desc: Build the project, to use a specific version use `task build TAG_VERSION=x.x.x` | ||
cmds: | ||
- go build -v -i {{.LDFLAGS}} | ||
- go build -v -i {{default "" .ADDITIONAL_FLAGS}} -o {{default "arduino-create-agent" .APP_NAME}} -ldflags '-X main.version={{default .TAG_TEST .TAG_VERSION}} -X main.git_revision={{.COMMIT}} {{default "" .WIN_FLAGS}}' | ||
vars: | ||
COMMIT: | ||
sh: git log -n 1 --format=%h | ||
|
||
build-cli: | ||
desc: Build the project without tray support | ||
cmds: | ||
- go build -v -i -tags cli -o {{.APP_NAME}}_cli {{.LDFLAGS}} | ||
- task: build | ||
vars: | ||
APP_NAME: arduino-create-agent_cli | ||
ADDITIONAL_FLAGS: -tags cli | ||
|
||
build-win32: | ||
desc: Build the project for win 32 bit | ||
build-win: | ||
desc: Build the project for win, to build 32bit `export GOARCH=386` and for 64 bit `export GOARCH=amd64` before `task build-win` | ||
cmds: | ||
- go build -v -i {{.WIN_LDFLAGS}} | ||
|
||
test: | ||
desc: Run the full testsuite, `legacy` will be skipped | ||
cmds: | ||
- task: test-unit | ||
- rsrc -arch {{.GOARCH}} -manifest manifest.xml # GOARCH shoud be either amd64 or 386 | ||
- task: build | ||
vars: | ||
APP_NAME: arduino-create-agent.exe | ||
WIN_FLAGS: -H=windowsgui | ||
- rm *.syso # rm file to avoid compilation problems on other platforms | ||
|
||
test-unit: | ||
desc: Run unit tests only | ||
|
@@ -43,38 +49,16 @@ tasks: | |
# - task: python:check | ||
# - task: docs:check | ||
# - task: config:check | ||
|
||
vars: | ||
TAG_TEST: "0.0.0-dev" | ||
GOARCH: | ||
sh: go env GOARCH | ||
# all modules of this project except for "gen/..." module | ||
DEFAULT_TARGETS: | ||
sh: echo `go list ./... | grep -v 'arduino-create-agent/gen/' | tr '\n' ' '` | ||
# build vars | ||
APP_NAME: arduino-create-agent | ||
WIN_FLAGS: -H=windowsgui | ||
COMMIT: | ||
sh: echo ${TRAVIS_COMMIT:-`git log -n 1 --format=%h`} | ||
TAG: | ||
sh: echo `git describe --tags --abbrev=0` | ||
LDFLAGS: > | ||
-ldflags '-X main.version={{.TAG}} | ||
-X main.git_revision={{.COMMIT}}' | ||
WIN_LDFLAGS: > | ||
-ldflags '-X main.version={{.TAG}} | ||
-X main.git_revision={{.COMMIT}} | ||
{{.WIN_FLAGS}}' | ||
# test vars | ||
GOFLAGS: "-timeout 10m -v -coverpkg=./... -covermode=atomic" | ||
TEST_VERSIONSTRING: "0.0.0-alpha" | ||
TEST_COMMIT: "deadbeef" | ||
TEST_LDFLAGS: > | ||
-ldflags '-X main.version={{.TEST_VERSIONSTRING}} | ||
-X main.git_revision={{.TEST_COMMIT}}' | ||
# check-lint vars | ||
GOLINTBIN: | ||
sh: go list -f {{"{{"}}".Target{{"}}"}}" golang.org/x/lint/golint | ||
GOLINTFLAGS: "-min_confidence 0.8 -set_exit_status" | ||
# # docs versioning | ||
# DOCS_VERSION: dev | ||
# DOCS_ALIAS: "" | ||
# DOCS_REMOTE: "origin" | ||
PRETTIER: [email protected] |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://github.community/t/create-matrix-with-multiple-os-and-env-for-each-one/16895