-
Notifications
You must be signed in to change notification settings - Fork 32
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 #19 from jetstack/release-readiness
Automatic release pipelines
- Loading branch information
Showing
9 changed files
with
146 additions
and
19 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
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,107 @@ | ||
name: release | ||
on: | ||
push: | ||
tags: | ||
- 'v*' | ||
jobs: | ||
docker_build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- | ||
name: Checkout | ||
uses: actions/checkout@v2 | ||
- | ||
name: Docker meta | ||
id: docker_meta | ||
uses: crazy-max/ghaction-docker-meta@v1 | ||
with: | ||
images: quay.io/jetstack/cert-manager-google-cas-issuer | ||
tag-semver: | | ||
{{version}} | ||
{{major}}.{{minor}} | ||
- | ||
name: Set up QEMU | ||
uses: docker/setup-qemu-action@v1 | ||
- | ||
name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v1 | ||
- | ||
name: Login to quay.io | ||
uses: docker/login-action@v1 | ||
with: | ||
registry: quay.io | ||
username: jake_jetstack | ||
password: ${{ secrets.QUAY_ENCRYPTED_PASSWORD }} | ||
- | ||
name: Build and push | ||
uses: docker/build-push-action@v2 | ||
if: ${{ !env.ACT }} | ||
with: | ||
context: . | ||
file: ./Dockerfile | ||
platforms: linux/amd64,linux/arm/v7,linux/arm64,linux/ppc64le | ||
push: true | ||
tags: ${{ steps.docker_meta.outputs.tags }} | ||
|
||
|
||
prepare_release: | ||
runs-on: ubuntu-latest | ||
container: golang:1.15 | ||
steps: | ||
- | ||
name: extract version | ||
id: extract_version | ||
run: echo ::set-output name=VERSION::$(echo ${GITHUB_REF##*/}) | ||
- | ||
name: install controller-gen | ||
working-directory: / | ||
env: | ||
GO111MODULE: on | ||
run: go get sigs.k8s.io/controller-tools/cmd/[email protected] | ||
- | ||
name: install kustomize | ||
working-directory: / | ||
env: | ||
GO111MODULE: on | ||
run: go get sigs.k8s.io/kustomize/kustomize/v3 | ||
- | ||
name: checkout repository | ||
uses: actions/checkout@v2 | ||
- | ||
name: generate manifests | ||
run: make manifests | ||
- | ||
name: generate deployment manifests | ||
id: deploy | ||
shell: bash | ||
env: | ||
IMG: quay.io/jetstack/cert-manager-google-cas-issuer | ||
run: | | ||
pushd config/manager | ||
kustomize edit set image controller=$IMG:${GITHUB_REF##*/} | ||
popd | ||
kustomize build config/default | tee google-cas-issuer-${GITHUB_REF##*/}.yaml | ||
- | ||
name: create release | ||
id: create_release | ||
uses: actions/create-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
tag_name: ${{ github.ref }} | ||
release_name: Release ${{ github.ref }} | ||
draft: true | ||
prerelease: false | ||
body: | | ||
docker images are available at `quay.io/jetstack/cert-manager-google-cas-issuer:${{ steps.extract_version.outputs.VERSION }} | ||
- name: Upload Release Asset | ||
id: upload-release-asset | ||
uses: actions/upload-release-asset@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps | ||
asset_path: ./google-cas-issuer-${{ steps.extract_version.outputs.VERSION }}.yaml | ||
asset_name: google-cas-issuer-${{ steps.extract_version.outputs.VERSION }}.yaml | ||
asset_content_type: application/x-yaml | ||
|
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,20 @@ | ||
name: tests | ||
on: [pull_request, push] | ||
jobs: | ||
run_tests: | ||
runs-on: ubuntu-latest | ||
container: golang:1.15 | ||
steps: | ||
- name: install kubebuilder | ||
run: | | ||
os=$(go env GOOS) | ||
arch=$(go env GOARCH) | ||
curl -L https://go.kubebuilder.io/dl/2.3.1/${os}/${arch} | tar -xz -C /tmp/ | ||
mv /tmp/kubebuilder_2.3.1_${os}_${arch} /usr/local/kubebuilder | ||
export PATH=$PATH:/usr/local/kubebuilder/bin | ||
- | ||
name: Checkout | ||
uses: actions/checkout@v2 | ||
- | ||
name: Run tests | ||
run: make test |
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
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