Skip to content

Commit

Permalink
Replace unmaintained release action
Browse files Browse the repository at this point in the history
Signed-off-by: Dale Haiducek <19750917+dhaiducek@users.noreply.github.com>
  • Loading branch information
dhaiducek committed Feb 29, 2024
1 parent 0671703 commit 530c8e0
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 21 deletions.
5 changes: 0 additions & 5 deletions .github/workflows/go-postsubmit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ on:
push:
branches:
- main
- release-*

jobs:
verify:
Expand All @@ -13,10 +12,6 @@ jobs:
steps:
- name: checkout code
uses: actions/checkout@v4
- name: install Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
- name: images
run: make build-images
- name: push
Expand Down
31 changes: 15 additions & 16 deletions .github/workflows/go-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,37 +4,36 @@ on:
push:
tags:
- 'v*.*.*'
workflow_dispatch: {}

env:
TAG: ${{ github.ref_name }}


jobs:
release:
name: release
runs-on: ubuntu-latest
steps:
- name: checkout code
uses: actions/checkout@v4
- name: install Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
- name: build images
run: |
make build-images
- name: push image
run: |
echo ${{ secrets.DOCKER_PASSWORD }} | docker login quay.io --username ${{ secrets.DOCKER_USER }} --password-stdin
docker push quay.io/open-cluster-management/config-policy-controller:$TAG
- name: generate changelog
run: |
echo "# config-policy-controller $TAG" > /home/runner/work/changelog.txt
echo "- The released image is quay.io/open-cluster-management/config-policy-controller:$TAG" >> /home/runner/work/changelog.txt
docker push quay.io/open-cluster-management/config-policy-controller:${TAG}
- name: publish release
uses: softprops/action-gh-release@v0.1.15
with:
body_path: /home/runner/work/changelog.txt
generate_release_notes: true
draft: true
prerelease: false
run: |
curl -L -X POST -H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
https://api.github.com/repos/${{ github.repository }}/releases \
-d '{
"tag_name": "'${TAG}'",
"target_commitish": "main",
"name": "'${TAG}'",
"body": "# config-policy-controller '${TAG}'/n- The released image is quay.io/open-cluster-management/config-policy-controller:'${TAG}'",
"draft": true,
"prerelease": false,
"generate_release_notes": true
}'

0 comments on commit 530c8e0

Please sign in to comment.