Skip to content

Commit 3e024dc

Browse files
authored
Merge pull request #284 from fluxcd/release-ci
Refactor release workflow
2 parents 2aefdc0 + 8a98b0f commit 3e024dc

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
@@ -64,35 +64,17 @@ jobs:
6464
docker buildx imagetools inspect ghcr.io/fluxcd/kustomize-controller:${{ steps.prep.outputs.VERSION }}
6565
docker pull docker.io/fluxcd/kustomize-controller:${{ steps.prep.outputs.VERSION }}
6666
docker pull ghcr.io/fluxcd/kustomize-controller:${{ steps.prep.outputs.VERSION }}
67-
- name: Generate release asset
68-
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
67+
- name: Generate release manifests
6968
run: |
7069
mkdir -p config/release
71-
cp config/default/* config/release
72-
cd config/release
73-
kustomize edit set image fluxcd/kustomize-controller=fluxcd/kustomize-controller:${{ steps.prep.outputs.VERSION }}
74-
kustomize build . > kustomize-controller.yaml
70+
kustomize build ./config/crd > ./config/release/kustomize-controller.crds.yaml
71+
kustomize build ./config/manager > ./config/release/kustomize-controller.deployment.yaml
7572
- name: Create release
76-
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
77-
id: create_release
78-
uses: actions/create-release@latest
79-
env:
80-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
73+
uses: ncipollo/release-action@v1
8174
with:
82-
tag_name: ${{ github.ref }}
83-
release_name: ${{ github.ref }}
84-
draft: false
8575
prerelease: true
76+
artifacts: "config/release/*.yaml"
77+
artifactContentType: "text/plain"
8678
body: |
8779
[CHANGELOG](https://github.com/fluxcd/kustomize-controller/blob/main/CHANGELOG.md)
88-
- name: Upload artifacts
89-
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
90-
id: upload-release-asset
91-
uses: actions/upload-release-asset@v1
92-
env:
93-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
94-
with:
95-
upload_url: ${{ steps.create_release.outputs.upload_url }}
96-
asset_path: ./config/release/kustomize-controller.yaml
97-
asset_name: kustomize-controller.yaml
98-
asset_content_type: text/plain
80+
token: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)