-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Migrate from Travis CI to GitHub Actions
- Loading branch information
1 parent
29326f9
commit 4553032
Showing
8 changed files
with
121 additions
and
38 deletions.
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 |
---|---|---|
@@ -0,0 +1,66 @@ | ||
--- | ||
name: CD | ||
on: | ||
push: | ||
tags: | ||
- "v*" | ||
jobs: | ||
release: | ||
name: Release | ||
timeout-minutes: 5 | ||
strategy: | ||
matrix: | ||
os: ["ubuntu-latest"] | ||
go-ver: ["1.13"] | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- name: Check out code | ||
uses: actions/checkout@v1 | ||
|
||
- name: Set up Go | ||
uses: actions/setup-go@v1 | ||
with: | ||
go-version: ${{ matrix.go-ver }} | ||
|
||
- name: Add $GOPATH/bin to $PATH | ||
run: echo "::add-path::$(go env GOPATH)/bin" | ||
|
||
- name: Install goxz | ||
run: | | ||
wget https://github.com/Songmu/${PKG_NAME}/releases/download/${PKG_VER}/${PKG_NAME}_${PKG_VER}_${GOOS}_${GOARCH}.tar.gz | ||
tar zxf ${PKG_NAME}_${PKG_VER}_${GOOS}_${GOARCH}.tar.gz | ||
mkdir -p $(go env GOPATH)/bin | ||
mv ${PKG_NAME}_${PKG_VER}_${GOOS}_${GOARCH}/${PKG_NAME} $(go env GOPATH)/bin/ | ||
env: | ||
PKG_NAME: goxz | ||
PKG_VER: v0.6.0 | ||
GOOS: linux | ||
GOARCH: amd64 | ||
|
||
- name: Install ghr | ||
run: | | ||
wget https://github.com/tcnksm/${PKG_NAME}/releases/download/${PKG_VER}/${PKG_NAME}_${PKG_VER}_${GOOS}_${GOARCH}.tar.gz | ||
tar zxf ${PKG_NAME}_${PKG_VER}_${GOOS}_${GOARCH}.tar.gz | ||
mkdir -p $(go env GOPATH)/bin | ||
mv ${PKG_NAME}_${PKG_VER}_${GOOS}_${GOARCH}/${PKG_NAME} $(go env GOPATH)/bin/ | ||
env: | ||
PKG_NAME: ghr | ||
PKG_VER: v0.13.0 | ||
GOOS: linux | ||
GOARCH: amd64 | ||
|
||
- name: Cross Compile | ||
run: make cross-compile | ||
|
||
- name: Create Release | ||
uses: actions/create-release@v1 | ||
with: | ||
tag_name: ${{ github.ref }} | ||
release_name: ${{ github.ref }} | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Upload Assets | ||
run: make upload-assets | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
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 |
---|---|---|
@@ -0,0 +1,32 @@ | ||
--- | ||
name: CI | ||
on: [push] | ||
jobs: | ||
test: | ||
name: Test | ||
timeout-minutes: 5 | ||
strategy: | ||
matrix: | ||
os: ["ubuntu-latest"] | ||
go-ver: ["1.13"] | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- name: Check out code | ||
uses: actions/checkout@v1 | ||
|
||
- name: Set up Go | ||
uses: actions/setup-go@v1 | ||
with: | ||
go-version: ${{ matrix.go-ver }} | ||
|
||
- name: Add $GOPATH/bin to $PATH | ||
run: echo "::add-path::$(go env GOPATH)/bin" | ||
|
||
- name: Get dependencies | ||
run: go get golang.org/x/lint/golint | ||
|
||
- name: Test | ||
run: make test | ||
|
||
- name: Lint | ||
run: make lint |
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,3 +1,4 @@ | ||
mackerel-plugin-solrdih | ||
main | ||
__debug_bin | ||
/dist/ |
This file was deleted.
Oops, something went wrong.
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
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,20 +1,29 @@ | ||
SHELL := /bin/bash | ||
SHELL := /bin/bash | ||
owner_id := supercaracal | ||
app_name := mackerel-plugin-solrdih | ||
latest_tag := $(shell git describe --abbrev=0 --tags) | ||
|
||
all: | ||
@$(MAKE) --no-print-directory lint | ||
@$(MAKE) --no-print-directory test | ||
@$(MAKE) --no-print-directory build | ||
all: build test lint | ||
|
||
build: mackerel-plugin-solrdih | ||
|
||
mackerel-plugin-solrdih: main.go | ||
GOOS=linux GOARCH=amd64 go build -ldflags="-s -w" -o $@ | ||
go build -ldflags="-s -w" -trimpath -o $@ | ||
|
||
test: | ||
go test | ||
|
||
lint: | ||
@go vet | ||
@golint -set_exit_status | ||
go vet | ||
golint -set_exit_status | ||
|
||
test: | ||
@go test | ||
clean: | ||
@rm -f mackerel-plugin-solrdih main | ||
|
||
cross-compile: | ||
goxz -d dist/${latest_tag} -z -os windows,darwin,linux -arch amd64,386 | ||
|
||
upload-assets: | ||
ghr -u ${owner_id} -r ${app_name} ${latest_tag} dist/${latest_tag} | ||
|
||
.PHONY: all build lint test | ||
.PHONY: all build test lint clean cross-compile upload-assets |
This file was deleted.
Oops, something went wrong.