Skip to content
Open
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
20 changes: 10 additions & 10 deletions .github/workflows/create-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ on:
tag:
type: string
required: true
pull_request:
schedule:
- cron: '00 2 * * *'

Expand All @@ -26,46 +27,45 @@ jobs:
with:
fetch-depth: 0
- name: Generate nightly release notes
if: github.event_name == 'schedule'
if: github.event_name == 'pull_request'
id: nightly_relnotes
run: |
echo "::set-output name=relnotes::$(git log --since="24 hours ago" --pretty=format:%s | awk 'NR>1{print "- "$0} NR==1{print "- "$0}')"
- name: Setup Python dependencies
if: github.event_name != 'schedule' || steps.nightly_relnotes.outputs.relnotes != ''
if: github.event_name != 'pull_request' || steps.nightly_relnotes.outputs.relnotes != ''
run: |
pip3 install mkdocs
pip3 install mkdocs-material
pip3 install mkdocs-localsearch
- name: Build and Archive
if: github.event_name != 'schedule' || steps.nightly_relnotes.outputs.relnotes != ''
if: github.event_name != 'pull_request' || steps.nightly_relnotes.outputs.relnotes != ''
run: |
npm install grunt-cli -g
npm install .
grunt
cd build && zip -r ../package.nw .
- name: Get Date
id: date
if: github.event_name != 'schedule' || steps.nightly_relnotes.outputs.relnotes != ''
if: github.event_name != 'pull_request' || steps.nightly_relnotes.outputs.relnotes != ''
run: echo "::set-output name=date::$(date +'%D')"
- name: Generate nightly tag
if: github.event_name != 'schedule' || steps.nightly_relnotes.outputs.relnotes != ''
if: github.event_name != 'pull_request' || steps.nightly_relnotes.outputs.relnotes != ''
id: nightly_tag
run: |
echo "::set-output name=tag::nightly_$(date +"%Y.%m.%d")"
- name: Tag Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/v')
with:
files: package.nw
files: release/package.nw
token: ${{ secrets.CSIDESHELL }}
- name: Release Nightly
uses: softprops/action-gh-release@v1
if: github.event_name == 'schedule' && steps.nightly_relnotes.outputs.relnotes != ''
if: github.event_name == 'pull_request' && steps.nightly_relnotes.outputs.relnotes != ''
with:
tag_name: ${{ steps.nightly_tag.outputs.tag }}
name: 'Nightly Release (${{ steps.date.outputs.date }})'
prerelease: true
files: package.nw
files: release/package.nw
body: <h2>Commit Changelog</h2>${{ steps.nightly_relnotes.outputs.relnotes }}
token: ${{ secrets.CSIDESHELL }}
- name: Triggered Release
Expand All @@ -75,6 +75,6 @@ jobs:
name: '${{ github.event.inputs.tag }} Release (${{ steps.date.outputs.date }})'
tag_name: ${{ github.event.inputs.tag }}
prerelease: ${{ github.event.inputs.prerelease }}
files: package.nw
files: release/package.nw
token: ${{ secrets.CSIDESHELL }}