From ba50390f0b7992ce45eeaeed1d0f0adcb59aaab9 Mon Sep 17 00:00:00 2001 From: Sergio Padrino Date: Tue, 27 Apr 2021 12:26:52 +0200 Subject: [PATCH 1/3] Add arm64 builds for darwin --- .travis.yml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index fb05172..0b22f66 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,19 +10,23 @@ go: git: depth: false +env: + - TARGET_ARCH: amd64 + - TARGET_ARCH: arm64 + install: '' script: - GIT_VERSION=$(git describe --tags) - - GO111MODULE=on go build -o smimesign -ldflags "-X main.versionString=$GIT_VERSION" . - - tar czf smimesign-$GIT_VERSION-macos.tgz smimesign + - GOARCH=$TARGET_ARCH GO111MODULE=on go build -o smimesign -ldflags "-X main.versionString=$GIT_VERSION" . + - tar czf smimesign-$GIT_VERSION-macos-$TARGET_ARCH.tgz smimesign - GO111MODULE=on go test -v ./... deploy: name: $GIT_VERSION provider: releases skip_cleanup: true - file: smimesign-$GIT_VERSION-macos.tgz + file: smimesign-$GIT_VERSION-macos-$TARGET_ARCH.tgz on: tags: true go: 1.x From 95a692ad7dcaa8f05ddac61779b10757684df706 Mon Sep 17 00:00:00 2001 From: Sergio Padrino Date: Tue, 27 Apr 2021 18:07:29 +0200 Subject: [PATCH 2/3] Add arm64 builds for darwin --- .travis.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 0b22f66..8cf13c4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,4 +1,5 @@ os: osx +osx_image: xcode12.3 language: go @@ -12,13 +13,15 @@ git: env: - TARGET_ARCH: amd64 + SDKROOT: /Library/Developer/CommandLineTools/SDKs/MacOSX11.1.sdk - TARGET_ARCH: arm64 + SDKROOT: /Library/Developer/CommandLineTools/SDKs/MacOSX11.1.sdk install: '' script: - GIT_VERSION=$(git describe --tags) - - GOARCH=$TARGET_ARCH GO111MODULE=on go build -o smimesign -ldflags "-X main.versionString=$GIT_VERSION" . + - CGO_ENABLED=1 GOARCH=$TARGET_ARCH GO111MODULE=on go build -o smimesign -ldflags "-X main.versionString=$GIT_VERSION" . - tar czf smimesign-$GIT_VERSION-macos-$TARGET_ARCH.tgz smimesign - GO111MODULE=on go test -v ./... From b0bebd92e5ae1a795de7d5b4600586b847cda672 Mon Sep 17 00:00:00 2001 From: Sergio Padrino Date: Tue, 27 Apr 2021 19:45:02 +0200 Subject: [PATCH 3/3] First attempt to use GH Actions --- .github/workflows/ci.yml | 66 ++++++++++++++++++++++++++++++++++++++++ .travis.yml | 37 ---------------------- 2 files changed, 66 insertions(+), 37 deletions(-) create mode 100644 .github/workflows/ci.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..e54212a --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,66 @@ +name: CI + +on: + push: + branches: + - main + tags: + - "v*" + pull_request: + +jobs: + build: + name: ${{ matrix.friendlyName }} ${{ matrix.arch }} (go ${{ matrix.go }}) + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + go: [1.12.x, 1.x, x] + os: [macos-10.15] + arch: [amd64, arm64] + include: + - os: macos-10.15 + friendlyName: macOS + # - os: windows-2019 + # friendlyName: Windows + exclude: + # For some reason, arm64 doesn't seem to be well supported with go 1.12.x + - arch: arm64 + go: 1.12.x + timeout-minutes: 60 + env: + # Needed for macOS arm64 until hosted macos-11.0 runners become available + SDKROOT: /Library/Developer/CommandLineTools/SDKs/MacOSX11.1.sdk + steps: + - uses: actions/checkout@v2 + with: + submodules: recursive + + - name: Use go ${{ matrix.go }} + uses: actions/setup-go@v2 + with: + go-version: ${{ matrix.go }} + + - name: Get app version + run: | + echo "GIT_VERSION=`git describe --tags`" >> $GITHUB_ENV + + - name: Build + run: | + CGO_ENABLED=1 GOARCH=${{ matrix.arch }} GO111MODULE=on go build \ + -o smimesign -ldflags "-X main.versionString=${{ env.GIT_VERSION }}" . + tar czf smimesign-${{ env.GIT_VERSION }}-macos-${{ matrix.arch }}.tgz \ + smimesign + env: + TARGET_ARCH: ${{ matrix.arch }} + + - name: Run tests + run: GO111MODULE=on go test -v ./... + + - name: Release + uses: softprops/action-gh-release@v1 + if: startsWith(github.ref, 'refs/tags/') && matrix.go == '1.x' + with: + files: smimesign-${{ env.GIT_VERSION }}-macos-${{ matrix.arch }}.tgz + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 8cf13c4..0000000 --- a/.travis.yml +++ /dev/null @@ -1,37 +0,0 @@ -os: osx -osx_image: xcode12.3 - -language: go - -go: - - 1.12.x - - 1.x - - master - -git: - depth: false - -env: - - TARGET_ARCH: amd64 - SDKROOT: /Library/Developer/CommandLineTools/SDKs/MacOSX11.1.sdk - - TARGET_ARCH: arm64 - SDKROOT: /Library/Developer/CommandLineTools/SDKs/MacOSX11.1.sdk - -install: '' - -script: - - GIT_VERSION=$(git describe --tags) - - CGO_ENABLED=1 GOARCH=$TARGET_ARCH GO111MODULE=on go build -o smimesign -ldflags "-X main.versionString=$GIT_VERSION" . - - tar czf smimesign-$GIT_VERSION-macos-$TARGET_ARCH.tgz smimesign - - GO111MODULE=on go test -v ./... - -deploy: - name: $GIT_VERSION - provider: releases - skip_cleanup: true - file: smimesign-$GIT_VERSION-macos-$TARGET_ARCH.tgz - on: - tags: true - go: 1.x - api_key: - secure: ETRXbCU4rdP7SE9ULTN9VqfzTiInav5LXjfvmuUo3GJTu1TmKOgsvo87aSK+ns/AkGiWXNXrHhwgfnC73jdT7o562bE/r3TG1QaBtiEcf5jn8d9HI5XXbCH1b2+yl6lpkhilDa7MxGO8d2C51gzvUyL3Zbnfqxbrploe4w3ZwnHJRObS55OQu8Ooyf1HaeK4hvoazT0Ww5Hg2joLYnB2Z9U7ucOdmQkQ8cnRZiyoSoczTnnY7JF0o83Ei5atMuDLFYR1zzKrYjBUs0Awl8tSK6t+I/dQgVYAX2QJrfkoJrXbQu5ytASvo3VUYSJkZHnGKvWi+dUbSOV+DB+uqQYYE8Ix+fOENnicuUFJuLXIWUiGJ0X3zZ2+2AeN0uHxlO1S3bJp5x8Vt5Q2uYaFQagNvkn7s9HSIy9rf6UR80a9brUiyqCQlLJcu3x+b5/KyRVyvlKupG5yD9PCv9wO1gjQts2mbCGjRQQ62Ub+PpiGQY+59jz3AjOtqrWaNkjSpAVVHkuj8Rl4X6OblCQOXskMnLk8gl2OLO7uhLlEcOUJiCbrqHZ75V1LTUa/TOx+xhQIOjTFgvbUTPQHz7eSuNVD3GuJCHMDzzUCVFaXcgX+dsDMbsqugubBRelrmCv+TS4AurCU8M3zGsZPYZV3uKt9zKIriZQ31b2hltGimRpDFDE=