-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #52 from PasteUs/dev
- Loading branch information
Showing
45 changed files
with
604 additions
and
439 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"address": "0.0.0.0", | ||
"port": 8000, | ||
"database": { | ||
"type": "mysql", | ||
"username": "username", | ||
"password": "password", | ||
"server": "localhost", | ||
"port": 4399, | ||
"database": "pasteme" | ||
} | ||
} |
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,12 @@ | ||
{ | ||
"address": "0.0.0.0", | ||
"port": 8000, | ||
"database": { | ||
"type": "sqlite3", | ||
"username": "username", | ||
"password": "password", | ||
"server": "localhost", | ||
"port": 4399, | ||
"database": "pasteme" | ||
} | ||
} |
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,21 @@ | ||
name-template: 'release-v$NEXT_PATCH_VERSION' | ||
tag-template: 'release-v$NEXT_PATCH_VERSION' | ||
categories: | ||
- title: 'Features' | ||
labels: | ||
- 'feature' | ||
- 'enhancement' | ||
- title: 'Bug Fixes' | ||
labels: | ||
- 'fix' | ||
- 'bugfix' | ||
- 'bug' | ||
- title: 'Maintenance' | ||
labels: | ||
- 'chore' | ||
- 'documentation' | ||
change-template: '- $TITLE (#$NUMBER) @$AUTHOR' | ||
template: | | ||
# Changes | ||
$CHANGES |
File renamed without changes.
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,50 @@ | ||
name: Publish for dev | ||
|
||
on: | ||
push: | ||
branches: | ||
- dev | ||
|
||
jobs: | ||
|
||
release: | ||
if: github.repository == 'PasteUs/PasteMeGoBackend' | ||
name: Build with go ${{ matrix.go_version }} on ${{ matrix.os }} and upload | ||
runs-on: ${{ matrix.os }} | ||
|
||
strategy: | ||
matrix: | ||
go_version: [1.13] | ||
os: [ubuntu-latest] | ||
|
||
steps: | ||
|
||
- name: Set up Go ${{ matrix.go_version }} | ||
uses: actions/setup-go@v1 | ||
with: | ||
go-version: ${{ matrix.go_version }} | ||
id: go | ||
|
||
- name: Check out code into the Go module directory | ||
uses: actions/checkout@v1 | ||
|
||
- name: Get dependencies | ||
run: | | ||
go get -v -t -d ./... | ||
if [ -f Gopkg.toml ]; then | ||
curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh | ||
dep ensure | ||
fi | ||
- name: Build | ||
run: | | ||
GOARCH=amd64 GOOS=linux go build -v -o pastemed . | ||
- name: Publish Docker | ||
uses: LucienShui/[email protected] | ||
with: | ||
name: registry.cn-hangzhou.aliyuncs.com/pasteus/pasteme-go-backend:beta | ||
username: ${{ secrets.DOCKER_USERNAME }} | ||
password: ${{ secrets.DOCKER_PASSWORD }} | ||
registry: registry.cn-hangzhou.aliyuncs.com | ||
dockerfile: Dockerfile |
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,50 @@ | ||
name: Publish for master | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
|
||
release: | ||
if: github.repository == 'PasteUs/PasteMeGoBackend' | ||
name: Build with go ${{ matrix.go_version }} on ${{ matrix.os }} and upload | ||
runs-on: ${{ matrix.os }} | ||
|
||
strategy: | ||
matrix: | ||
go_version: [1.13] | ||
os: [ubuntu-latest] | ||
|
||
steps: | ||
|
||
- name: Set up Go ${{ matrix.go_version }} | ||
uses: actions/setup-go@v1 | ||
with: | ||
go-version: ${{ matrix.go_version }} | ||
id: go | ||
|
||
- name: Check out code into the Go module directory | ||
uses: actions/checkout@v1 | ||
|
||
- name: Get dependencies | ||
run: | | ||
go get -v -t -d ./... | ||
if [ -f Gopkg.toml ]; then | ||
curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh | ||
dep ensure | ||
fi | ||
- name: Build | ||
run: | | ||
GOARCH=amd64 GOOS=linux go build -v -o pastemed . | ||
- name: Publish Docker | ||
uses: LucienShui/[email protected] | ||
with: | ||
name: registry.cn-hangzhou.aliyuncs.com/pasteus/pasteme-go-backend:latest | ||
username: ${{ secrets.DOCKER_USERNAME }} | ||
password: ${{ secrets.DOCKER_PASSWORD }} | ||
registry: registry.cn-hangzhou.aliyuncs.com | ||
dockerfile: Dockerfile |
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,17 @@ | ||
name: Release Drafter | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
draft_release: | ||
if: github.repository == 'PasteUs/PasteMeGoBackend' | ||
name: Draft release | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: toolmantim/[email protected] | ||
name: Draft | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_PASSWORD }} |
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,117 @@ | ||
name: Go Test | ||
on: [pull_request] | ||
jobs: | ||
|
||
build: | ||
strategy: | ||
matrix: | ||
go_version: [1.12, 1.13] | ||
os: [ubuntu-latest] | ||
|
||
name: Build with go ${{ matrix.go_version }} on ${{ matrix.os }} | ||
runs-on: ${{ matrix.os }} | ||
|
||
steps: | ||
- name: Set up Go ${{ matrix.go_version }} | ||
uses: actions/setup-go@v1 | ||
with: | ||
go-version: ${{ matrix.go_version }} | ||
id: go | ||
|
||
- name: Check out code into the Go module directory | ||
uses: actions/checkout@v1 | ||
|
||
- name: Get dependencies | ||
run: | | ||
go get -v -t -d ./... | ||
if [ -f Gopkg.toml ]; then | ||
curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh | ||
dep ensure | ||
fi | ||
- name: Build | ||
run: | | ||
GOARCH=amd64 GOOS=linux go build -v -o pastemed . | ||
test_with_mysql: | ||
strategy: | ||
matrix: | ||
# go_version: [1.12, 1.13] | ||
# remove 1.13 for https://github.com/golang/go/issues/31859 | ||
go_version: [1.12] | ||
mysql_version: [5.5, 5.7, 8] | ||
os: [ubuntu-latest] | ||
|
||
name: Test with go ${{ matrix.go_version }} using mysql:${{ matrix.mysql_version }} on ${{ matrix.os }} | ||
runs-on: ${{ matrix.os }} | ||
|
||
services: | ||
mysql: | ||
image: mysql:${{ matrix.mysql_version }} | ||
env: | ||
MYSQL_USER: username | ||
MYSQL_PASSWORD: password | ||
MYSQL_ROOT_PASSWORD: password | ||
MYSQL_DATABASE: pasteme | ||
ports: | ||
- 4399:3306 | ||
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 | ||
|
||
steps: | ||
- name: Set up Go ${{ matrix.go_version }} | ||
uses: actions/setup-go@v1 | ||
with: | ||
go-version: ${{ matrix.go_version }} | ||
id: go | ||
|
||
- name: Check out code into the Go module directory | ||
uses: actions/checkout@v1 | ||
|
||
- name: Get dependencies | ||
run: | | ||
go get -v -t -d ./... | ||
if [ -f Gopkg.toml ]; then | ||
curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh | ||
dep ensure | ||
fi | ||
- name: Test | ||
run: | | ||
rm -f pasteme.db server/pasteme.db | ||
cp .github/config/config.mysql.json server/config.json | ||
bash gotest.sh | ||
test_with_sqlite3: | ||
strategy: | ||
matrix: | ||
# go_version: [1.12, 1.13] | ||
# remove 1.13 for https://github.com/golang/go/issues/31859 | ||
go_version: [1.12] | ||
os: [ubuntu-latest] | ||
|
||
name: Test with go ${{ matrix.go_version }} using sqlite3 on ${{ matrix.os }} | ||
runs-on: ${{ matrix.os }} | ||
|
||
steps: | ||
- name: Set up Go ${{ matrix.go_version }} | ||
uses: actions/setup-go@v1 | ||
with: | ||
go-version: ${{ matrix.go_version }} | ||
id: go | ||
|
||
- name: Check out code into the Go module directory | ||
uses: actions/checkout@v1 | ||
|
||
- name: Get dependencies | ||
run: | | ||
go get -v -t -d ./... | ||
if [ -f Gopkg.toml ]; then | ||
curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh | ||
dep ensure | ||
fi | ||
- name: Test | ||
run: | | ||
rm -f pasteme.db server/pasteme.db | ||
cp .github/config/config.sqlite3.json server/config.json | ||
bash gotest.sh |
Oops, something went wrong.