diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e0b0be12e2..8933d2107d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,9 +1,17 @@ -on: - push: - branches: [main] - name: Release +on: + schedule: + # 9 AM UTC on every Monday + - cron: "0 9 * * Mon" + workflow_dispatch: + inputs: + pre-release: + type: boolean + description: Mark "Pre-Release" + required: false + default: true + permissions: contents: write @@ -119,9 +127,19 @@ jobs: tag: ${{ github.ref_name }} run: ${{ github.run_number }} run: | + if [[ "${{ github.event.inputs.pre-release }}" == "true" ]]; then + RELEASE_TYPE_NAME=Pre-Release + PRERELEASE_ARG=--prerelease + else + RELEASE_TYPE_NAME=Release + PRERELEASE_ARG= + fi + today=$(date '+%Y-%m-%d') gh release create "$today-$tag-$run" \ --repo="$GITHUB_REPOSITORY" \ - --title="RustPython Release $today-$tag #$run" \ + --title="RustPython $RELEASE_TYPE_NAME $today-$tag #$run" \ --target="$tag" \ + --generate-notes \ + $PRERELEASE_ARG \ bin/rustpython-release-* \ No newline at end of file