-
Notifications
You must be signed in to change notification settings - Fork 168
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Transfer Circle CI Automation to Github Actions (#335)
* initial set up of github actions yml * change run on to ubuntu latest * roll back to our runners * add test + clean step * remove working directory * add make distributables step * add release workflow Co-authored-by: Enrico Alvarenga <[email protected]> * define two tag patterns to trigger chamber pkg release * remove circleci references * remove extra space in new line * change secrets' names * test docker hub login on build workflow * cleanup build workflow * fix default branch Co-authored-by: Enrico Alvarenga <[email protected]> Co-authored-by: Enrico Alvarenga <[email protected]>
- Loading branch information
1 parent
f989b21
commit 3353ad1
Showing
7 changed files
with
189 additions
and
160 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 |
---|---|---|
@@ -1,3 +1,2 @@ | ||
.git | ||
.github | ||
.circleci |
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,93 @@ | ||
|
||
name: Test & Build | ||
on: | ||
push: | ||
branches: | ||
- master | ||
|
||
pull_request: | ||
|
||
jobs: | ||
install-go-modules: | ||
strategy: | ||
matrix: | ||
go: ['1.16.x', '1.15.x'] | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Setup Go ${{ matrix.go }} | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: ${{ matrix.go }} | ||
|
||
- name: Test install Go modules for v${{ matrix.go }} | ||
run: go get -v . && chamber version | ||
|
||
test: | ||
strategy: | ||
matrix: | ||
go: ['1.16.x'] | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Setup Go | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: ${{ matrix.go }} | ||
|
||
- name: Test | ||
run: make test | ||
|
||
- name: Check modules are tidy and checked in | ||
run: | | ||
export GO111MODULE=on | ||
go mod tidy | ||
if [ "$(git status --porcelain)" != "" ]; then | ||
echo "git tree is dirty after tidying modules" | ||
echo "ensure go.mod and go.sum are tidy" | ||
git status | ||
exit 1 | ||
fi | ||
dist: | ||
strategy: | ||
matrix: | ||
go: ['1.16.x'] | ||
runs-on: ubuntu-latest | ||
needs: test | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Setup Go | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: ${{ matrix.go }} | ||
|
||
- name: Install nfpm, rpmbuild | ||
run: sudo make -f Makefile.tools nfpm-debian rpmbuild-debian | ||
|
||
- name: Make distributables | ||
run: make -f Makefile.release dist | ||
- uses: actions/upload-artifact@v3 | ||
with: | ||
name: dist | ||
path: 'dist/*' | ||
|
||
test-dockerhub-login: | ||
runs-on: ubuntu-latest | ||
needs: dist | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Login to DockerHub | ||
uses: docker/login-action@v1 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USER }} | ||
password: ${{ secrets.DOCKERHUB_PASSWD }} |
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,93 @@ | ||
name: Release | ||
on: | ||
push: | ||
tags: | ||
- 'v[0-9]+.[0-9]+.[0-9]+' | ||
- 'v[0-9]+.[0-9]+.[0-9]-[a-zA-Z0-9]+' | ||
|
||
jobs: | ||
dist: | ||
strategy: | ||
matrix: | ||
go: ['1.16.x'] | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Setup Go | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: ${{ matrix.go }} | ||
|
||
- name: Install nfpm, rpmbuild | ||
run: sudo make -f Makefile.tools nfpm-debian rpmbuild-debian | ||
|
||
- name: Make distributables | ||
run: make -f Makefile.release dist | ||
- uses: actions/upload-artifact@v3 | ||
with: | ||
name: dist | ||
path: 'dist/*' | ||
|
||
publish-github: | ||
strategy: | ||
matrix: | ||
go: ['1.16.x'] | ||
runs-on: ubuntu-latest | ||
needs: dist | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- uses: actions/download-artifact@v3 | ||
with: | ||
name: dist | ||
path: 'dist/*' | ||
|
||
- name: Setup Go | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: ${{ matrix.go }} | ||
|
||
- name: Install tools | ||
run: make -f Makefile.tools github-release | ||
|
||
- name: Release | ||
run: make -f Makefile.release publish-github | ||
|
||
publish-dockerhub: | ||
strategy: | ||
matrix: | ||
go: ['1.16.x'] | ||
runs-on: ubuntu-latest | ||
needs: dist | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- uses: actions/download-artifact@v3 | ||
with: | ||
name: dist | ||
path: 'dist/*' | ||
|
||
- name: Setup Go | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: ${{ matrix.go }} | ||
|
||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v1 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v1 | ||
|
||
- name: Login to DockerHub | ||
uses: docker/login-action@v1 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USER }} | ||
password: ${{ secrets.DOCKERHUB_PASSWD }} | ||
|
||
- name: Release | ||
run: | ||
make -f Makefile.release publish-dockerhub |
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