Skip to content

Commit

Permalink
Switch to GitHub Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
crazy-max committed Aug 24, 2019
1 parent c40b98b commit 5542328
Show file tree
Hide file tree
Showing 6 changed files with 115 additions and 65 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: build

on:
push:
branches:
- "*"
tags:
- "!*"

jobs:
build:
runs-on: windows-latest
steps:
- name: Dump GitHub context
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
run: echo "$GITHUB_CONTEXT"
-
name: Set up Go
uses: actions/setup-go@v1
with:
go-version: 1.12.4
-
name: Set GOPATH
# temporary fix
# see https://github.com/actions/setup-go/issues/14
run: |
echo "##[set-env name=GOPATH;]$(dirname $GITHUB_WORKSPACE)"
echo "##[add-path]$(dirname $GITHUB_WORKSPACE)/bin"
shell: bash
-
name: Set up JDK
uses: actions/setup-java@v1
with:
java-version: 11
-
name: Checkout
uses: actions/checkout@v1
-
name: Build
run: |
go get -u github.com/kevinburke/go-bindata/go-bindata
go get -u github.com/josephspurrier/goversioninfo/cmd/goversioninfo
ant -noinput release
ls -al bin/release/
shell: bash
60 changes: 60 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: release

on:
push:
branches:
- "!*"
tags:
- "*.*.*"

jobs:
release:
runs-on: windows-latest
steps:
- name: Dump GitHub context
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
run: echo "$GITHUB_CONTEXT"
-
name: Set TAG_NAME
run: |
echo "##[set-env name=TAG_NAME;]$(cat $GITHUB_EVENT_PATH | jq -r .ref | awk -F '/' '{print $3}')"
shell: bash
-
name: Set up Go
uses: actions/setup-go@v1
with:
go-version: 1.12.4
-
name: Set GOPATH
# temporary fix (see https://github.com/actions/setup-go/issues/14)
run: |
echo "##[set-env name=GOPATH;]$(dirname $GITHUB_WORKSPACE)"
echo "##[add-path]$(dirname $GITHUB_WORKSPACE)/bin"
shell: bash
-
name: Set up JDK
uses: actions/setup-java@v1
with:
java-version: 11
-
name: Checkout
uses: actions/checkout@v1
-
name: Build
run: |
go get -u github.com/kevinburke/go-bindata/go-bindata
go get -u github.com/josephspurrier/goversioninfo/cmd/goversioninfo
ant -noinput release
ls -al bin/release/
shell: bash
-
name: Deploy
if: success()
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
go get -u github.com/tcnksm/ghr
ghr --version
ghr -n ${TAG_NAME} -draft ${TAG_NAME} bin/release/
shell: bash
56 changes: 0 additions & 56 deletions .travis.yml

This file was deleted.

6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
<p align="center">
<a href="https://github.com/crazy-max/WindowsSpyBlocker/releases/latest"><img src="https://img.shields.io/github/release/crazy-max/WindowsSpyBlocker.svg?style=flat-square" alt="GitHub release"></a>
<a href="https://github.com/crazy-max/WindowsSpyBlocker/releases/latest"><img src="https://img.shields.io/github/downloads/crazy-max/WindowsSpyBlocker/total.svg?style=flat-square" alt="Total downloads"></a>
<a href="https://travis-ci.com/crazy-max/WindowsSpyBlocker"><img src="https://img.shields.io/travis/com/crazy-max/WindowsSpyBlocker/master.svg?style=flat-square" alt="Build Status"></a>
<a href="https://github.com/crazy-max/WindowsSpyBlocker/actions"><img src="https://github.com/crazy-max/WindowsSpyBlocker/workflows/build/badge.svg" alt="Build Status"></a>
<a href="https://goreportcard.com/report/github.com/crazy-max/WindowsSpyBlocker"><img src="https://goreportcard.com/badge/github.com/crazy-max/WindowsSpyBlocker?style=flat-square" alt="Go Report"></a>
<a href="https://www.codacy.com/app/crazy-max/WindowsSpyBlocker"><img src="https://img.shields.io/codacy/grade/1e2eae1a40754d88b7956cf9bd30241b.svg?style=flat-square" alt="Code Quality"></a>
<br /><a href="https://www.patreon.com/crazymax"><img src="https://img.shields.io/badge/donate-patreon-fb664e.svg?style=flat-square" alt="Support me on Patreon"></a>
<a href="https://www.paypal.me/crazyws"><img src="https://img.shields.io/badge/donate-paypal-7057ff.svg?style=flat-square" alt="Donate Paypal"></a>
<br /><a href="https://www.patreon.com/crazymax"><img src="https://img.shields.io/badge/donate-patreon-f96854.svg?logo=patreon&style=flat-square" alt="Support me on Patreon"></a>
<a href="https://www.paypal.me/crazyws"><img src="https://img.shields.io/badge/donate-paypal-00457c.svg?logo=paypal&style=flat-square" alt="Donate Paypal"></a>
</p>

## About
Expand Down
8 changes: 4 additions & 4 deletions build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -43,16 +43,16 @@
</macrodef>

<!-- Version -->
<condition property="app.version" value="${env.TRAVIS_TAG}">
<condition property="app.version" value="${env.TAG_NAME}">
<and>
<isset property="env.TRAVIS_TAG"/>
<not><equals arg1="${env.TRAVIS_TAG}" arg2=""/></not>
<isset property="env.TAG_NAME"/>
<not><equals arg1="${env.TAG_NAME}" arg2=""/></not>
</and>
</condition>
<condition property="app.version" value="1.0.0"><not><isset property="app.version"/></not></condition>

<!-- Build number -->
<condition property="app.release" value="${env.TRAVIS_BUILD_NUMBER}"><isset property="env.TRAVIS_BUILD_NUMBER"/></condition>
<condition property="app.release" value="${env.BUILD_NUMBER}"><isset property="env.BUILD_NUMBER"/></condition>
<condition property="app.release" value="0"><not><isset property="app.release"/></not></condition>

<target name="release" depends="init, load.lib, infos, downmod, generate, build" description="Release">
Expand Down
4 changes: 2 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//go:generate go install -v github.com/kevinburke/go-bindata/go-bindata
//go:generate go get -u github.com/kevinburke/go-bindata/go-bindata
//go:generate go-bindata -pkg bindata -o app/bindata/bindata.go app/settings.json data/... app.conf
//go:generate go install -v github.com/josephspurrier/goversioninfo/cmd/goversioninfo
//go:generate go get -u github.com/josephspurrier/goversioninfo/cmd/goversioninfo
//go:generate goversioninfo -icon=app.ico -manifest=app.manifest

package main
Expand Down

0 comments on commit 5542328

Please sign in to comment.