Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

automate releases and notification #3003

Merged
merged 1 commit into from
Aug 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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