diff --git a/.github/workflows/create-release.yml b/.github/workflows/create-release.yml index 846ecea..2eef4c3 100644 --- a/.github/workflows/create-release.yml +++ b/.github/workflows/create-release.yml @@ -10,6 +10,7 @@ on: tag: type: string required: true + pull_request: schedule: - cron: '00 2 * * *' @@ -26,29 +27,28 @@ 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")" @@ -56,16 +56,16 @@ jobs: 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: