Skip to content

Commit

Permalink
Merge pull request #3 from crenshaw-dev/release
Browse files Browse the repository at this point in the history
release
  • Loading branch information
crenshaw-dev authored Nov 1, 2022
2 parents ba84d17 + ebfce01 commit fdf0660
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 6 deletions.
17 changes: 11 additions & 6 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ on:
branches:
- main
types: [ opened, synchronize, reopened ]
workflow_call:
inputs:
tag:
type: string
required: true

permissions:
contents: read
Expand All @@ -26,25 +31,25 @@ jobs:
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
username: crenshawdotdev
password: ${{ secrets.DOCKERHUB_PASSWORD }}
- name: Build and push
uses: docker/build-push-action@v3
with:
context: .
push: ${{ github.event_name == 'push' }}
tags: crenshawdotdev/argocd-executor-plugin:latest
tags: crenshawdotdev/argocd-executor-plugin:${{ inputs.tag || 'latest' }}
- name: Install cosign
uses: sigstore/cosign-installer@main
with:
cosign-release: 'v1.13.0'
if: ${{ github.event_name == 'push' }}
- name: Sign latest image
if: ${{ github.event_name == 'push' || github.event_name == 'workflow_call' }}
- name: Sign ${{ inputs.tag }} image
run: |
cosign sign --key env://COSIGN_PRIVATE_KEY crenshawdotdev/argocd-executor-plugin:latest
cosign sign --key env://COSIGN_PRIVATE_KEY crenshawdotdev/argocd-executor-plugin:${{ inputs.tag }}
# Displays the public key to share.
cosign public-key --key env://COSIGN_PRIVATE_KEY
env:
COSIGN_PRIVATE_KEY: ${{secrets.COSIGN_PRIVATE_KEY}}
COSIGN_PASSWORD: ${{secrets.COSIGN_PASSWORD}}
if: ${{ github.event_name == 'push' }}
if: ${{ github.event_name == 'push' || github.event_name == 'workflow_call' }}
51 changes: 51 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Create argocd-executor-plugin release
on:
workflow_dispatch:
inputs:
tag:
required: true

permissions:
contents: read

jobs:
build-and-push:
uses: crenshaw-dev/argocd-executor-plugin/.github/workflows/build.yaml@main
with:
tag: ${{ github.event.inputs.tag }}
if: github.repository == 'crenshaw-dev/argocd-executor-plugin'
prepare-release:
permissions:
contents: write # To push changes to release branch
name: Release
if: github.repository == 'crenshaw-dev/argocd-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: Push release tag
run: |
set -ue
git config --global user.email "${GIT_EMAIL}"
git config --global user.name "${GIT_USERNAME}"
git tag ${RELEASE_TAG}
git push origin ${RELEASE_TAG}
- 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

0 comments on commit fdf0660

Please sign in to comment.