Skip to content

Commit

Permalink
Merge pull request #3003 from nextcloud/workflow/releases-actions
Browse files Browse the repository at this point in the history
automate releases and notification
  • Loading branch information
dartcafe authored Aug 1, 2023
2 parents 0a0aef3 + eecdd55 commit cc1d45f
Show file tree
Hide file tree
Showing 5 changed files with 67 additions and 10 deletions.
11 changes: 11 additions & 0 deletions .github/BETA_NOTIFICATION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
title: Polls {{ env.VERSION }} released ({{ date | date('DD-MM-YYYY') }})
labels: Announcement
---
# Changelog for the upcomming release (preview)
{{ env.RELEASENOTES }}

# Downloads
Overview and changelog: https://github.com/nextcloud/polls/releases/tag/{{ env.TAG }}
Download ZIP: https://github.com/nextcloud/polls/releases/download/{{ env.TAG }}/polls-{{ env.VERSION }}.zip
Download TAR.GZ: https://github.com/nextcloud/polls/releases/download/{{ env.TAG }}/polls-{{ env.VERSION }}.tar.gz
12 changes: 12 additions & 0 deletions .github/RELEASE_NOTIFICATION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
title: Polls {{ env.VERSION }} released ({{ date | date('DD-MM-YYYY') }})
labels: Announcement
---
# Releasenotes {{ env.VERSION }}
## [{{ env.VERSION }}] - {{ date | date('YYYY-MM-DD') }}
{{ env.RELEASENOTES }}

# Downloads
Overview and changelog: https://github.com/nextcloud/polls/releases/tag/{{ env.TAG }}
Download ZIP: https://github.com/nextcloud/polls/releases/download/{{ env.TAG }}/polls-{{ env.VERSION }}.zip
Download TAR.GZ: https://github.com/nextcloud/polls/releases/download/{{ env.TAG }}/polls-{{ env.VERSION }}.tar.gz
2 changes: 1 addition & 1 deletion .github/actions/get-polls-version/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ runs:

- name: Get tag name
id: gettag
run: echo ::set-output name=VERSION::$(echo $GITHUB_REF | cut -d / -f 3)
run: echo "VERSION=$(echo $GITHUB_REF | cut -d / -f 3)" >> $GITHUB_OUTPUT
shell: bash

- name: Compare versions
Expand Down
27 changes: 22 additions & 5 deletions .github/workflows/publish_beta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
runs-on: ubuntu-latest
name: Beta release
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Check correct app version
id: appinfo
uses: ./.github/actions/get-polls-version
Expand All @@ -31,11 +31,11 @@ jobs:
- name: build
run: npm run build --if-present

- name: Make appstore package
- name: Make appstore package ${{ steps.appinfo.outputs.app-version }}
if: success()
run: make package

- name: rename package
- name: rename packages to polls-${{ steps.appinfo.outputs.app-version }}
if: success()
run: mv build/artifacts/appstore/polls.tar.gz build/artifacts/appstore/polls-${{ steps.appinfo.outputs.app-version }}.tar.gz

Expand All @@ -46,13 +46,30 @@ jobs:
zip -r ../artifacts/appstore/polls-${{ steps.appinfo.outputs.app-version }}.zip *
popd
- name: Publish pre-release
- name: Extract release notes
if: success()
id: extract-release-notes
uses: ffurrer2/extract-release-notes@v1

- name: Publish pre-release ${{ steps.appinfo.outputs.app-version }}
if: success()
uses: softprops/action-gh-release@v1
with:
with:
body: "# Changelog for the upcomming release (preview)\n ${{ steps.extract-release-notes.outputs.release_notes }} "
prerelease: true
draft: false
generate_release_notes: true
files: |
build/artifacts/appstore/polls-${{ steps.appinfo.outputs.app-version }}.tar.gz
build/artifacts/appstore/polls-${{ steps.appinfo.outputs.app-version }}.zip
- name: Create release notification issue
if: success()
uses: JasonEtco/create-an-issue@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
RELEASENOTES: ${{ steps.extract-release-notes.outputs.release_notes }}
VERSION: ${{ steps.appinfo.outputs.app-version }}
TAG: ${{ steps.appinfo.outputs.tag-version }}
with:
filename: .github/BETA_NOTIFICATION.md
25 changes: 21 additions & 4 deletions .github/workflows/publish_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest
name: Release
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Check correct app version
id: appinfo
uses: ./.github/actions/get-polls-version
Expand All @@ -30,11 +30,11 @@ jobs:
- name: build
run: npm run build --if-present

- name: Make appstore package
- name: Make appstore package ${{ steps.appinfo.outputs.app-version }}
if: success()
run: make package

- name: rename package
- name: rename packages to polls-${{ steps.appinfo.outputs.app-version }}
if: success()
run: mv build/artifacts/appstore/polls.tar.gz build/artifacts/appstore/polls-${{ steps.appinfo.outputs.app-version }}.tar.gz

Expand All @@ -45,13 +45,30 @@ jobs:
zip -r ../artifacts/appstore/polls-${{ steps.appinfo.outputs.app-version }}.zip *
popd
- name: Extract release notes
if: success()
id: extract-release-notes
uses: ffurrer2/extract-release-notes@v1

- name: Draft Release
if: success()
uses: softprops/action-gh-release@v1
with:
body: "# Changelog ${{ steps.appinfo.outputs.app-version }} \n ${{ steps.extract-release-notes.outputs.release_notes }} "
prerelease: false
draft: true
draft: false
generate_release_notes: true
files: |
build/artifacts/appstore/polls-${{ steps.appinfo.outputs.app-version }}.tar.gz
build/artifacts/appstore/polls-${{ steps.appinfo.outputs.app-version }}.zip
- name: Create release notification issue
if: success()
uses: JasonEtco/create-an-issue@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
RELEASENOTES: ${{ steps.extract-release-notes.outputs.release_notes }}
VERSION: ${{ steps.appinfo.outputs.app-version }}
TAG: ${{ steps.appinfo.outputs.tag-version }}
with:
filename: .github/RELEASE_NOTIFICATION.md

0 comments on commit cc1d45f

Please sign in to comment.