File tree Expand file tree Collapse file tree 2 files changed +61
-5
lines changed Expand file tree Collapse file tree 2 files changed +61
-5
lines changed Original file line number Diff line number Diff line change 8
8
branches :
9
9
- main
10
10
types : [ opened, synchronize, reopened ]
11
+ workflow_call :
12
+ inputs :
13
+ tag :
14
+ type : string
15
+ default : ' latest'
11
16
12
17
permissions :
13
18
contents : read
@@ -33,18 +38,18 @@ jobs:
33
38
with :
34
39
context : .
35
40
push : ${{ github.event_name == 'push' }}
36
- tags : crenshawdotdev/argocd-executor-plugin:latest
41
+ tags : crenshawdotdev/argocd-executor-plugin:${{ inputs.tag }}
37
42
- name : Install cosign
38
43
uses : sigstore/cosign-installer@main
39
44
with :
40
45
cosign-release : ' v1.13.0'
41
- if : ${{ github.event_name == 'push' }}
42
- - name : Sign latest image
46
+ if : ${{ github.event_name == 'push' || github.event_name == 'workflow_call' }}
47
+ - name : Sign ${{ inputs.tag }} image
43
48
run : |
44
- cosign sign --key env://COSIGN_PRIVATE_KEY crenshawdotdev/argocd-executor-plugin:latest
49
+ cosign sign --key env://COSIGN_PRIVATE_KEY crenshawdotdev/argocd-executor-plugin:${{ inputs.tag }}
45
50
# Displays the public key to share.
46
51
cosign public-key --key env://COSIGN_PRIVATE_KEY
47
52
env :
48
53
COSIGN_PRIVATE_KEY : ${{secrets.COSIGN_PRIVATE_KEY}}
49
54
COSIGN_PASSWORD : ${{secrets.COSIGN_PASSWORD}}
50
- if : ${{ github.event_name == 'push' }}
55
+ if : ${{ github.event_name == 'push' || github.event_name == 'workflow_call' }}
Original file line number Diff line number Diff line change
1
+ name : Create argocd-executor-plugin release
2
+ on :
3
+ workflow_dispatch :
4
+ inputs :
5
+ tag :
6
+ required : true
7
+
8
+ permissions :
9
+ contents : read
10
+
11
+ jobs :
12
+ build-and-push :
13
+ uses : crenshaw-dev/argocd-executor-plugin/.github/workflows/build.yaml@main
14
+ with :
15
+ tag : ${{ github.event.inputs.tag }}
16
+ if : github.repository == 'crenshaw-dev/argocd-executor-plugin'
17
+ prepare-release :
18
+ permissions :
19
+ contents : write # To push changes to release branch
20
+ name : Release
21
+ if : github.repository == 'crenshaw-dev/argocd-executor-plugin'
22
+ runs-on : ubuntu-22.04
23
+ env :
24
+ GIT_USERNAME : crenshaw-dev
25
+
26
+ RELEASE_TAG : ${{ github.event.inputs.tag }}
27
+ steps :
28
+ - name : Checkout code
29
+ uses : actions/checkout@v3
30
+ with :
31
+ fetch-depth : 0
32
+ token : ${{ secrets.GITHUB_TOKEN }}
33
+
34
+ - name : Push release tag
35
+ run : |
36
+ set -ue
37
+
38
+ git config --global user.email "${GIT_EMAIL}"
39
+ git config --global user.name "${GIT_USERNAME}"
40
+
41
+ git tag ${RELEASE_TAG}
42
+ git push origin ${RELEASE_TAG}
43
+
44
+ - name : Create GitHub release
45
+ uses : softprops/action-gh-release@v1
46
+ env :
47
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
48
+ with :
49
+ name : ${{ env.RELEASE_TAG }}
50
+ tag_name : ${{ env.RELEASE_TAG }}
51
+ generate_release_notes : true
You can’t perform that action at this time.
0 commit comments