generated from argoproj-labs/argo-workflows-hello-executor-plugin
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
10f1b76
commit cd2c8f4
Showing
16 changed files
with
547 additions
and
34 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,54 @@ | ||
name: Build image | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- main | ||
types: [ opened, synchronize, reopened ] | ||
workflow_call: | ||
inputs: | ||
tag: | ||
type: string | ||
required: true | ||
secrets: | ||
DOCKERHUB_PASSWORD: | ||
required: true | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
publish: | ||
if: github.repository == 'crenshaw-dev/github-executor-plugin' | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Set up go | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: 1.19 | ||
- name: Test | ||
run: make test | ||
- name: Upload coverage to Codecov | ||
uses: codecov/codecov-action@v3 | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v2 | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
- name: Login to Docker Hub | ||
uses: docker/login-action@v2 | ||
with: | ||
username: crenshawdotdev | ||
password: ${{ secrets.DOCKERHUB_PASSWORD || inputs.DOCKERHUB_PASSWORD }} | ||
- name: Build and push | ||
uses: docker/build-push-action@v3 | ||
with: | ||
context: . | ||
push: ${{ github.event_name != 'pull_request' }} | ||
tags: crenshawdotdev/github-executor-plugin:${{ inputs.tag || 'latest' }} | ||
cache-from: type=gha | ||
cache-to: type=gha,mode=max |
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: Codegen | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- main | ||
types: [ opened, synchronize, reopened ] | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
publish: | ||
if: github.repository == 'crenshaw-dev/github-executor-plugin' | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- run: | | ||
# Install Argo CLI. | ||
curl -sLO https://github.com/argoproj/argo-workflows/releases/download/v3.4.4/argo-linux-amd64.gz | ||
gunzip argo-linux-amd64.gz | ||
chmod +x argo-linux-amd64 | ||
mv ./argo-linux-amd64 /usr/local/bin/argo | ||
argo version | ||
make manifests | ||
git diff --exit-code |
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,66 @@ | ||
name: Create release | ||
on: | ||
workflow_dispatch: | ||
inputs: | ||
tag: | ||
required: true | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
build: | ||
uses: crenshaw-dev/github-executor-plugin/.github/workflows/build.yaml@main | ||
with: | ||
tag: ${{ github.event.inputs.tag }} | ||
secrets: | ||
DOCKERHUB_PASSWORD: ${{ secrets.DOCKERHUB_PASSWORD }} | ||
prepare-release: | ||
needs: build | ||
permissions: | ||
contents: write # To push changes to release branch | ||
name: Release | ||
if: github.repository == 'crenshaw-dev/github-executor-plugin' | ||
runs-on: ubuntu-22.04 | ||
env: | ||
GIT_USERNAME: crenshaw-dev | ||
GIT_EMAIL: [email protected] | ||
RELEASE_TAG: ${{ github.event.inputs.tag }} | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Update plugin.yaml image tag | ||
id: manifests | ||
uses: mikefarah/yq@master | ||
with: | ||
cmd: yq -i '.spec.sidecar.container.image = "crenshawdotdev/github-executor-plugin:" + strenv(RELEASE_TAG)' manifests/plugin.yaml | ||
- name: Update install manifest | ||
run: | | ||
# Download the binary | ||
curl -sLO https://github.com/argoproj/argo-workflows/releases/download/v3.4.3/argo-linux-amd64.gz | ||
gunzip argo-linux-amd64.gz | ||
chmod +x argo-linux-amd64 | ||
./argo-linux-amd64 executor-plugin build ./manifests | ||
- name: Push release tag | ||
run: | | ||
set -ue | ||
git config --global user.email "${GIT_EMAIL}" | ||
git config --global user.name "${GIT_USERNAME}" | ||
git commit manifests/ -m "Bump version to $RELEASE_TAG" | ||
git push origin HEAD | ||
git tag ${RELEASE_TAG} | ||
git push origin ${RELEASE_TAG} --force | ||
- name: Create GitHub release | ||
uses: softprops/action-gh-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
name: ${{ env.RELEASE_TAG }} | ||
tag_name: ${{ env.RELEASE_TAG }} | ||
generate_release_notes: true |
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 +1,2 @@ | ||
.idea | ||
cover.out |
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
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
Oops, something went wrong.