Skip to content

Commit 81aadbf

Browse files
committed
Refactor release workflow
Signed-off-by: Stefan Prodan <[email protected]>
1 parent d51c556 commit 81aadbf

File tree

1 file changed

+7
-25
lines changed

1 file changed

+7
-25
lines changed

.github/workflows/release.yml

+7-25
Original file line numberDiff line numberDiff line change
@@ -67,35 +67,17 @@ jobs:
6767
docker buildx imagetools inspect ghcr.io/fluxcd/${CONTROLLER}:${{ steps.prep.outputs.VERSION }}
6868
docker pull docker.io/fluxcd/${CONTROLLER}:${{ steps.prep.outputs.VERSION }}
6969
docker pull ghcr.io/fluxcd/${CONTROLLER}:${{ steps.prep.outputs.VERSION }}
70-
- name: Generate release asset
71-
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
70+
- name: Generate release manifests
7271
run: |
7372
mkdir -p config/release
74-
cp config/default/* config/release
75-
cd config/release
76-
kustomize edit set image fluxcd/${CONTROLLER}=fluxcd/${CONTROLLER}:${{ steps.get_version.outputs.VERSION }}
77-
kustomize build . > ${CONTROLLER}.yaml
73+
kustomize build ./config/crd > ./config/release/${{ env.CONTROLLER }}.crds.yaml
74+
kustomize build ./config/manager > ./config/release/${{ env.CONTROLLER }}.deployment.yaml
7875
- name: Create release
79-
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
80-
id: create_release
81-
uses: actions/create-release@latest
82-
env:
83-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
76+
uses: ncipollo/release-action@v1
8477
with:
85-
tag_name: ${{ github.ref }}
86-
release_name: ${{ github.ref }}
87-
draft: false
8878
prerelease: true
79+
artifacts: "config/release/*.yaml"
80+
artifactContentType: "text/plain"
8981
body: |
9082
[CHANGELOG](https://github.com/fluxcd/${{ env.CONTROLLER }}/blob/main/CHANGELOG.md)
91-
- name: Upload artifacts
92-
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
93-
id: upload-release-asset
94-
uses: actions/upload-release-asset@v1
95-
env:
96-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
97-
with:
98-
upload_url: ${{ steps.create_release.outputs.upload_url }}
99-
asset_path: ./config/release/${{ env.CONTROLLER }}.yaml
100-
asset_name: ${{ env.CONTROLLER }}.yaml
101-
asset_content_type: text/plain
83+
token: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)