Skip to content

Commit

Permalink
add release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
zensh committed Mar 7, 2020
1 parent 89278b1 commit df59e7b
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 7 deletions.
51 changes: 51 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Urbs-Setting Release
on:
push:
# Sequence of patterns matched against refs/tags
tags:
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10

jobs:
build:
name: Build And Upload Release Asset
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.14
uses: actions/setup-go@v1
with:
go-version: 1.14
id: go

- name: Check out code into the Go module directory
uses: actions/checkout@v2

- name: Get dependencies
run: |
go get -v -d ./...
- name: Build project # This would actually build your project, using zip for an example artifact
run: |
make build
zip -j ./dist/urbs-setting.linux-amd64.zip ./dist/urbs-setting
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: false

- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: ./dist/urbs-setting.linux-amd64.zip
asset_name: urbs-setting.linux-amd64.zip
asset_content_type: application/zip
20 changes: 13 additions & 7 deletions .github/workflows/go.yml → .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,18 @@
name: Urbs-Setting
on: [push]
jobs:
name: Urbs-Setting Test
on:
# Trigger the workflow on push or pull request,
# but only for the master branch
push:
branches:
- master
- develop
pull_request:
branches:
- master

jobs:
build:
name: Build
name: Testing
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.14
Expand Down Expand Up @@ -33,6 +42,3 @@ jobs:
- name: Test
run: |
CONFIG_FILE_PATH=${PWD}/config/test_on_github.yml APP_ENV=test go test -v ./...
- name: Build
run: make build
2 changes: 2 additions & 0 deletions config/default.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
addr: ":3000"
cert_file:
key_file:
logger:
level: debug
mysql:
Expand Down

0 comments on commit df59e7b

Please sign in to comment.