Skip to content

Commit

Permalink
Merge pull request #7 from dunglas/build
Browse files Browse the repository at this point in the history
Add a build pipeline
  • Loading branch information
dunglas committed May 18, 2020
2 parents f8ff401 + d68fe7f commit 1b109e3
Show file tree
Hide file tree
Showing 14 changed files with 963 additions and 72 deletions.
76 changes: 76 additions & 0 deletions .github/CODE_OF_CONDUCT.md
@@ -0,0 +1,76 @@
# Contributor Code of Conduct

## Our Pledge

In the interest of fostering an open and welcoming environment, we as
contributors and maintainers pledge to make participation in our project and
our community a harassment-free experience for everyone, regardless of age, body
size, disability, ethnicity, sex characteristics, gender identity and expression,
level of experience, education, socio-economic status, nationality, personal
appearance, ethnicity, religion, or sexual identity and orientation.

## Our Standards

Examples of behavior that contributes to creating a positive environment
include:

* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members

Examples of unacceptable behavior by participants include:

* The use of sexualized language or imagery and unwelcome sexual attention or
advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic
address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting

## Our Responsibilities

Project maintainers are responsible for clarifying the standards of acceptable
behavior and are expected to take appropriate and fair corrective action in
response to any instances of unacceptable behavior.

Project maintainers have the right and responsibility to remove, edit, or
reject comments, commits, code, wiki edits, issues, and other contributions
that are not aligned to this Code of Conduct, or to ban temporarily or
permanently any contributor for other behaviors that they deem inappropriate,
threatening, offensive, or harmful.

## Scope

This Code of Conduct applies within all project spaces, and it also applies when
an individual is representing the project or its community in public spaces.
Examples of representing a project or community include using an official
project e-mail address, posting via an official social media account, or acting
as an appointed representative at an online or offline event. Representation of
a project may be further defined and clarified by project maintainers.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project team at dunglas+coc@gmail.com. All
complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. The project team is
obligated to maintain confidentiality with regard to the reporter of an incident.
Further details of specific enforcement policies may be posted separately.

Project maintainers who do not follow or enforce the Code of Conduct in good
faith may face temporary or permanent repercussions as determined by other
members of the project's leadership.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html

[homepage]: https://www.contributor-covenant.org

For answers to common questions about this code of conduct, see
https://www.contributor-covenant.org/faq
1 change: 1 addition & 0 deletions .github/FUNDING.yml
@@ -0,0 +1 @@
github: dunglas
30 changes: 30 additions & 0 deletions .github/workflows/cd.yml
@@ -0,0 +1,30 @@
name: CD

on:
push:
tags:
- 'v*'

jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: '1.14'
- name: Docker Hub Login
run: docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD"
env:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
- name: Release
uses: goreleaser/goreleaser-action@v1
with:
version: latest
args: release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
20 changes: 20 additions & 0 deletions .github/workflows/ci.yaml
@@ -0,0 +1,20 @@
name: CI

on:
push:
pull_request:

env:
GO111MODULE: 'on'

jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@master
- name: Lint Go Code
uses: docker://golangci/golangci-lint:latest
with:
args: golangci-lint run ./...
51 changes: 51 additions & 0 deletions .goreleaser.yml
@@ -0,0 +1,51 @@
before:
hooks:
- go mod download
builds:
-
env:
- CGO_ENABLED=0
goos:
- linux
- darwin
- windows
goarch:
- 386
- amd64
- arm
- arm64
archives:
-
replacements:
darwin: Darwin
linux: Linux
windows: Windows
386: i386
amd64: x86_64
files:
- COPYRIGHT
- LICENSE
- README.md
- public/*
format_overrides:
- goos: windows
format: zip
checksum:
name_template: 'checksums.txt'
snapshot:
name_template: "{{ .Tag }}-next"
changelog:
sort: asc
filters:
exclude:
- '^docs:'
- '^test:'
dockers:
-
image_templates:
- 'dunglas/uri-template-tester:{{ .Tag }}'
- 'dunglas/uri-template-tester:v{{ .Major }}'
- 'dunglas/uri-template-tester:v{{ .Major }}.{{ .Minor }}'
- 'dunglas/uri-template-tester:latest'
extra_files:
- public/
37 changes: 37 additions & 0 deletions COPYRIGHT
@@ -0,0 +1,37 @@
Copyright (C) 2019-present Kévin Dunglas

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License, version 3,
as published by the Free Software Foundation.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.

As a special exception, the copyright holders give permission to link the
code of portions of this program with the OpenSSL library under certain
conditions as described in each individual source file and distribute
linked combinations including the program with the OpenSSL library. You
must comply with the GNU Affero General Public License in all respects
for all of the code used other than as permitted herein. If you modify
file(s) with this exception, you may extend this exception to your
version of the file(s), but you are not obligated to do so. If you do not
wish to do so, delete this exception statement from your version. If you
delete this exception statement from all source files in the program,
then also delete it in the license file.

The copyright holders provide the following statement as a clarification
of the conditions of this License. This statement is not a further
restriction. It will be deemed a legal notice allowed under Section 7b,
and must accordingly be preserved in any redistribution of the Program.
This clarification applies to the URI Template Tester licensed hereunder by
Kévin Dunglas. The Corresponding Source of the Program includes any
software that interacts with the Program and contains functionality to
provision or manage the Program for the purpose of enabling third-party
users to interact with the Program remotely through a computer network,
and any such software that is added to or combined with the Program
constitutes modification that produces a work based on the Program.
5 changes: 5 additions & 0 deletions Dockerfile
@@ -0,0 +1,5 @@
FROM gcr.io/distroless/static
COPY uri-template-tester /
COPY public /public/
CMD ["/uri-template-tester"]
EXPOSE 80 443

0 comments on commit 1b109e3

Please sign in to comment.