File tree 3 files changed +53
-10
lines changed
3 files changed +53
-10
lines changed Original file line number Diff line number Diff line change @@ -65,17 +65,20 @@ jobs:
65
65
IMGPKG_REGISTRY_USERNAME : ${{ github.actor }}
66
66
IMGPKG_REGISTRY_PASSWORD : ${{ secrets.GITHUB_TOKEN }}
67
67
run : |
68
- imgpkg push -b ghcr.io/${{ github.repository_owner }}/sealed-secrets-carvel:${{ env.chart_version }} -f .
68
+ imgpkg push -b ghcr.io/${{ github.repository_owner }}/sealed-secrets-carvel:${{ env.chart_version }} -f . --json > output
69
+ echo carvel_pkg=$(cat output | grep Pushed | cut -d "'" -f2 ) >> $GITHUB_ENV
69
70
70
71
- name : Update package.yaml
71
72
run : |
72
73
yq -i '.spec.version = "${{ env.chart_version }}"' carvel/package.yaml
73
74
yq -i '.metadata.name = "sealedsecrets.bitnami.com.${{ env.chart_version }}"' carvel/package.yaml
74
- yq -i '.spec.template.spec.fetch.0.imgpkgBundle.image = "ghcr.io/${{ github.repository_owner }}/sealed-secrets-carvel:${{ env.chart_version }}"' carvel/package.yaml
75
+ yq -i '.spec.template.spec.fetch.0.imgpkgBundle.image = "${{ env.carvel_pkg }}"' carvel/package.yaml
76
+ git checkout -B 'release-carvel-${{ env.chart_version }}'
77
+ git add carvel/package.yaml
78
+ git commit -m 'Release carvel package ${{ env.chart_version }}'
79
+ git push origin 'release-carvel-${{ env.chart_version }}'
75
80
76
- # Commenting the git commit action
77
- # - name: Commit package.yaml
78
- # run: |
79
- # git add ./carvel/package.yaml
80
- # git commit -s -m 'Update package to version ${{ env.chart_version }}'
81
- # git push
81
+ - name : Create PR
82
+ run : gh pr create --fill --base main --repo $GITHUB_REPOSITORY
83
+ env :
84
+ GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
Original file line number Diff line number Diff line change @@ -2,9 +2,14 @@ name: Publish Release
2
2
3
3
on :
4
4
workflow_dispatch :
5
+ inputs :
6
+ chart :
7
+ description : ' Chart version (e.g. 2.11.3)'
8
+ required : true
9
+ type : string
5
10
6
11
jobs :
7
- build :
12
+ release :
8
13
runs-on : ubuntu-latest
9
14
env :
10
15
controller_dockerhub_image_name : docker.io/bitnami/sealed-secrets-controller
@@ -153,3 +158,38 @@ jobs:
153
158
COSIGN_PASSWORD : ${{ secrets.COSIGN_PASSWORD }}
154
159
TAG_CURRENT : ${{ steps.meta_kubeseal.outputs.tags }}
155
160
COSIGN_REPOSITORY : ${{ env.kubeseal_ghcr_image_name }}/signs
161
+
162
+ chart-pr :
163
+ needs : release
164
+ runs-on : ubuntu-latest
165
+ steps :
166
+ - name : Checkout
167
+ uses : actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3
168
+ with :
169
+ fetch-depth : 0
170
+
171
+ - name : Config Git
172
+ run : |
173
+ git config user.name "$GITHUB_ACTOR"
174
+ git config user.email "[email protected] "
175
+
176
+ - name : Fetch Versions
177
+ run : |
178
+ echo NEW_VERSION=$(git describe --tags --match "v[0-9]*" --abbrev=0 | tr -d v) >> "$GITHUB_ENV"
179
+ echo PREV_VERSION=$(grep appVersion helm/sealed-secrets/Chart.yaml | grep -o '[0-9.]*') >> "$GITHUB_ENV"
180
+
181
+ - name : Update Version
182
+ run : |
183
+ sed -i "s/version: .*/version: ${{ inputs.chart }}/" helm/sealed-secrets/Chart.yaml
184
+ sed -i "s/appVersion: .*/appVersion: $NEW_VERSION/" helm/sealed-secrets/Chart.yaml
185
+ sed -i "s/tag: .*/tag: $NEW_VERSION/" helm/sealed-secrets/values.yaml
186
+ sed -i "s/\`$PREV_VERSION\`/\`$NEW_VERSION\`/" helm/sealed-secrets/README.md
187
+ git checkout -B 'release-chart-${{ inputs.chart }}'
188
+ git add helm/sealed-secrets/Chart.yaml helm/sealed-secrets/values.yaml helm/sealed-secrets/README.md
189
+ git commit -m 'Release chart ${{ inputs.chart }}'
190
+ git push origin 'release-chart-${{ inputs.chart }}'
191
+
192
+ - name : Create PR
193
+ run : gh pr create --fill --base main --repo $GITHUB_REPOSITORY
194
+ env :
195
+ GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
Original file line number Diff line number Diff line change 1
- name : Release
1
+ name : Prepare Release
2
2
3
3
# Only release when a new GH release branch is pushed
4
4
on :
You can’t perform that action at this time.
0 commit comments