Skip to content

Commit

Permalink
re-enable tests and builds
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelPalmer1 committed Oct 1, 2020
1 parent 9343c25 commit 1a5116d
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 66 deletions.
120 changes: 61 additions & 59 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,69 +5,69 @@ on:
types: [created]

jobs:
# test:
# name: Run tests
# runs-on: ${{ matrix.os }}
# strategy:
# matrix:
# os:
# - macos-latest
# - ubuntu-latest
# - windows-latest
# steps:
# - name: Checkout code
# uses: actions/checkout@v2
# - name: Set up Go 1.x
# uses: actions/setup-go@v2
# with:
# go-version: ^1.14
# - name: Run tests
# run: make ci
#
# build-all:
# name: Build all platforms
# runs-on: macos-latest
# needs: test
# steps:
# # strip off refs/tags/ and the v prefix (if it exists)
# - name: Set release env var
# run: |
# version=${GITHUB_REF#refs/*/}
# stripped_version=${version#v}
# echo ::set-env name=VERSION::${stripped_version}
# - name: Checkout code
# uses: actions/checkout@v2
# - name: Set up Go 1.x
# uses: actions/setup-go@v2
# with:
# go-version: ^1.14
# - name: Vendor packages
# run: make mod
# - name: Install CI utilities
# run: make prepare
# - name: Compile binaries
# run: make compile
# - name: Package binaries
# run: make dist
#
# - name: Get release information
# id: get_release
# uses: bruceadams/[email protected]
# env:
# GITHUB_TOKEN: ${{ github.token }}
#
# - name: Upload Release Assets
# uses: NBTX/upload-release-assets@v1
# env:
# GITHUB_TOKEN: ${{ github.token }}
# with:
# upload_url: ${{ steps.get_release.outputs.upload_url }}
# targets: ./dist/*
test:
name: Run tests
runs-on: ${{ matrix.os }}
strategy:
matrix:
os:
- macos-latest
- ubuntu-latest
- windows-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Go 1.x
uses: actions/setup-go@v2
with:
go-version: ^1.14
- name: Run tests
run: make ci

build-all:
name: Build all platforms
runs-on: macos-latest
needs: test
steps:
# strip off refs/tags/ and the v prefix (if it exists)
- name: Set release env var
run: |
version=${GITHUB_REF#refs/*/}
stripped_version=${version#v}
echo ::set-env name=VERSION::${stripped_version}
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Go 1.x
uses: actions/setup-go@v2
with:
go-version: ^1.14
- name: Vendor packages
run: make mod
- name: Install CI utilities
run: make prepare
- name: Compile binaries
run: make compile
- name: Package binaries
run: make dist

- name: Get release information
id: get_release
uses: bruceadams/[email protected]
env:
GITHUB_TOKEN: ${{ github.token }}

- name: Upload Release Assets
uses: NBTX/upload-release-assets@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.get_release.outputs.upload_url }}
targets: ./dist/*

choco:
name: Publish to Chocolatey
runs-on: windows-latest
# needs: test
needs: test

steps:
- name: Set up Go 1.x
Expand All @@ -84,6 +84,8 @@ jobs:
- name: Build gossamer3 and push to choco
run: .\choco\deploy.ps1

# ----------------------------------------------------------------------------------------------------------------------

# build-mac:
# name: Mac build
# runs-on: macos-latest
Expand Down
10 changes: 3 additions & 7 deletions choco/deploy.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@ Set-StrictMode -Version 'Latest'

$version = $env:GITHUB_REF.Split("/")[2].Split('v')[1]

# Choco is already installed on Github runners
#echo "Install choco"
#Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))

echo "Building gossamer3"
go build -o "bin/gossamer3.exe" -ldflags "-X main.Version=${version}" "./cmd/gossamer3"

Expand All @@ -26,6 +22,6 @@ echo "Zipping binary"
$hash = Get-FileHash "gossamer3.zip"
"$($hash.Hash) $(Split-Path $hash.Path -Leaf)" > "gossamer3.zip.sha256"

#echo "Push to choco"
#choco apiKey -k $env:CHOCO_API_KEY -source https://push.chocolatey.org/
#choco push "./gossamer3.${version}.nupkg"
echo "Push to choco"
choco apiKey -k $env:CHOCO_API_KEY -source https://push.chocolatey.org/
choco push "./gossamer3.${version}.nupkg"

0 comments on commit 1a5116d

Please sign in to comment.