Skip to content

Commit

Permalink
gh actions (#145)
Browse files Browse the repository at this point in the history
* use GitHub actions instead of cicleCI
  • Loading branch information
pbalogh-sa authored Feb 17, 2022
1 parent 9f34b7d commit 0ac3f18
Show file tree
Hide file tree
Showing 5 changed files with 97 additions and 212 deletions.
205 changes: 0 additions & 205 deletions .circleci/config.yml

This file was deleted.

35 changes: 35 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Build PKE
on:
pull_request:
branches: [master]
paths-ignore:
- "README.md"
- "docs/**"

jobs:
build:
name: Build
runs-on: ubuntu-latest

steps:
- name: Set up Go 1.17
uses: actions/setup-go@v2
with:
go-version: 1.17

- name: Check out code
uses: actions/checkout@v2

- name: Check licenses
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: make license-check

- name: Build code
run: make build

- name: Lint code
run: make lint

- name: Run test
run: GOARGS="-p=2" make test
32 changes: 32 additions & 0 deletions .github/workflows/image-build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Trigger PKE image build
on:
push:
tags:
- "[0-9]+.[0-9]+.[0-9]+"

jobs:
trigger-image-build:
runs-on: ubuntu-latest
needs: release

steps:

- name: Check out code
uses: actions/checkout@v2
- name: Set env
run: ::set-output name=tag::${GITHUB_REF#refs/*/}

- name: Trigger pke-image build
uses: actions/github-script@v6
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
await github.rest.actions.createWorkflowDispatch({
owner: 'banzaicloud',
repo: 'pke-image',
workflow_id: 'packer-build.yml',
ref: 'master',
inputs: {
tag: '${{ steps.vars.outputs.tag }}'
}
})
30 changes: 30 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Release PKE
on:
push:
tags:
- "*"

jobs:
release:
name: Release
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.17

- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
with:
distribution: goreleaser
version: 1.5.0
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
7 changes: 0 additions & 7 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,3 @@ nfpms:
bindir: /usr/local/bin
license: Apache 2.0
file_name_template: "{{ .ProjectName }}-{{ .Version }}_{{ .Os }}_{{ .Arch }}"

blobs:
-
provider: s3
bucket: banzaicloud.com
region: us-east-1
folder: "downloads/pke"

0 comments on commit 0ac3f18

Please sign in to comment.