-
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.
Merge pull request #1 from dolittle/first-release
First release
- Loading branch information
Showing
5 changed files
with
143 additions
and
0 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,6 @@ | ||
.git/ | ||
.github/ | ||
.gitignore | ||
Dockerfile | ||
LICENSE | ||
README.md |
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,29 @@ | ||
## Summary | ||
|
||
Summary of the PR here. The GitHub release description is created from this comment so keep it nice and descriptive. | ||
|
||
Remember to remove sections that you don't need or use. | ||
|
||
### Added | ||
|
||
- Describe the added features | ||
|
||
### Changed | ||
|
||
- Describe the outwards facing code change | ||
|
||
### Fixed | ||
|
||
- Describe the fix and the bug | ||
|
||
### Removed | ||
|
||
- Describe what was removed and why | ||
|
||
### Security | ||
|
||
- Describe the security issue and the fix | ||
|
||
### Deprecated | ||
|
||
- Describe the part of the code being deprecated and why |
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: Build | ||
|
||
on: | ||
push: | ||
branches: | ||
- '**' | ||
|
||
jobs: | ||
build: | ||
name: Build + Test | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-go@v2 | ||
with: | ||
go-version: 1.18 | ||
- name: Build | ||
run: go build . | ||
- name: Test | ||
run: go test -v ./... | ||
docker: | ||
name: Build Docker image | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: docker/setup-qemu-action@v1 | ||
- uses: docker/setup-buildx-action@v1 | ||
- name: Build Docker image | ||
uses: docker/build-push-action@v2 | ||
with: | ||
push: false | ||
platforms: linux/amd64,linux/arm64 |
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,64 @@ | ||
name: Release | ||
|
||
env: | ||
PRERELEASE_BRANCHES: | ||
|
||
on: | ||
pull_request: | ||
types: [closed] | ||
|
||
jobs: | ||
release: | ||
name: Release | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: docker/setup-qemu-action@v1 | ||
- uses: docker/setup-buildx-action@v1 | ||
- uses: docker/login-action@v1 | ||
with: | ||
username: ${{ secrets.DOCKER_USERNAME }} | ||
password: ${{ secrets.DOCKER_PASSWORD }} | ||
- name: Establish context | ||
id: context | ||
uses: dolittle/establish-context-action@v2 | ||
with: | ||
prerelease-branches: ${{ env.PRERELEASE_BRANCHES }} | ||
- name: Increment version | ||
id: increment-version | ||
if: ${{ steps.context.outputs.should-publish == 'true' }} | ||
uses: dolittle/increment-version-action@v2 | ||
with: | ||
version: ${{ steps.context.outputs.current-version }} | ||
release-type: ${{ steps.context.outputs.release-type }} | ||
- name: Prepend to Changelog | ||
if: ${{ steps.context.outputs.should-publish == 'true' && steps.context.outputs.release-type != 'prerelease' }} | ||
uses: dolittle/add-to-changelog-action@v2 | ||
with: | ||
version: ${{ steps.increment-version.outputs.next-version }} | ||
body: ${{ steps.context.outputs.pr-body }} | ||
pr-url: ${{ steps.context.outputs.pr-url }} | ||
changelog-path: CHANGELOG.md | ||
user-email: [email protected] | ||
user-name: dolittle-build | ||
- name: Create GitHub Release | ||
id: create-release | ||
uses: dolittle/github-release-action@v2 | ||
if: ${{ steps.context.outputs.should-publish == 'true' }} | ||
with: | ||
token: ${{ secrets.BUILD_PAT }} | ||
version: ${{ steps.increment-version.outputs.next-version }} | ||
body: ${{ steps.context.outputs.pr-body }} | ||
- name: Push Docker image to Docker Hub | ||
uses: docker/build-push-action@v2 | ||
with: | ||
push: true | ||
platforms: linux/amd64,linux/arm64 | ||
tags: dolittle/contracts-compatibility:${{ steps.increment-version.outputs.next-version }} | ||
- name: Push Latest tag of Docker image to Docker Hub | ||
uses: docker/build-push-action@v2 | ||
if: ${{ steps.context.outputs.release-type != 'prerelease' }} | ||
with: | ||
push: true | ||
platforms: linux/amd64,linux/arm64 | ||
tags: dolittle/contracts-compatibility:latest |
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 @@ | ||
FROM --platform=$BUILDPLATFORM golang:1.18.0 as build | ||
ARG TARGETARCH | ||
|
||
WORKDIR /go/src/contracts-compatibility | ||
COPY . /go/src/contracts-compatibility | ||
ENV CGO_ENABLED=0 | ||
ENV GOARCH $TARGETARCH | ||
RUN go build -o /go/bin/contracts-compatibility . | ||
|
||
FROM gcr.io/distroless/static-debian11 | ||
COPY --from=build /go/bin/contracts-compatibility /bin/contracts-compatibility | ||
ENTRYPOINT ["/bin/contracts-compatibility"] |