Skip to content

Commit

Permalink
First attempt to use GH Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
sergiou87 committed Apr 27, 2021
1 parent 95a692a commit e1b0b33
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 37 deletions.
61 changes: 61 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: CI

on:
push:
branches:
- main
tags:
- "v*"
pull_request:

jobs:
build:
name: ${{ matrix.friendlyName }} ${{ matrix.arch }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
go: [1.12.x, 1.x, master]
os: [macos-10.15]
arch: [amd64, arm64]
include:
- os: macos-10.15
friendlyName: macOS
# - os: windows-2019
# friendlyName: Windows
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 }}
37 changes: 0 additions & 37 deletions .travis.yml

This file was deleted.

0 comments on commit e1b0b33

Please sign in to comment.