Refactor release workflow

Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
This commit is contained in:
Stefan Prodan 2021-02-23 17:13:41 +02:00
parent 22c6082eb6
commit 8fa30c1aac
No known key found for this signature in database
GPG Key ID: 3299AEB0E4085BAF
1 changed files with 9 additions and 26 deletions

View File

@ -20,13 +20,6 @@ jobs:
fi
echo ::set-output name=BUILD_DATE::$(date -u +'%Y-%m-%dT%H:%M:%SZ')
echo ::set-output name=VERSION::${VERSION}
- name: Generate release asset
run: |
mkdir -p config/release
cp config/default/* config/release
cd config/release
kustomize edit set image fluxcd/notification-controller=fluxcd/notification-controller:${{ steps.prep.outputs.VERSION }}
kustomize build . > notification-controller.yaml
- name: Setup QEMU
uses: docker/setup-qemu-action@v1
with:
@ -71,27 +64,17 @@ jobs:
docker buildx imagetools inspect ghcr.io/fluxcd/notification-controller:${{ steps.prep.outputs.VERSION }}
docker pull docker.io/fluxcd/notification-controller:${{ steps.prep.outputs.VERSION }}
docker pull ghcr.io/fluxcd/notification-controller:${{ steps.prep.outputs.VERSION }}
- name: Generate release manifests
run: |
mkdir -p config/release
kustomize build ./config/crd > ./config/release/notification-controller.crds.yaml
kustomize build ./config/manager > ./config/release/notification-controller.deployment.yaml
- name: Create release
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
id: create_release
uses: actions/create-release@latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
uses: ncipollo/release-action@v1
with:
tag_name: ${{ github.ref }}
release_name: ${{ github.ref }}
draft: false
prerelease: true
artifacts: "config/release/*.yaml"
artifactContentType: "text/plain"
body: |
[CHANGELOG](https://github.com/fluxcd/notification-controller/blob/main/CHANGELOG.md)
- name: Upload artifacts
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./config/release/notification-controller.yaml
asset_name: notification-controller.yaml
asset_content_type: text/plain
token: ${{ secrets.GITHUB_TOKEN }}