forked from cylc/cylc-flow
-
Notifications
You must be signed in to change notification settings - Fork 0
58 lines (49 loc) · 1.89 KB
/
2_auto_publish_release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
name: Release stage 2 - auto publish
on:
pull_request: # types AND paths
types: [closed]
paths: ['cylc/flow/__init__.py']
# NOTE: While this is too generic, we use the `if` condition of the job to narrow it down
# NOTE: Don't use `branches` as we might create release on any branch
env:
# Best not to include the GH token here, only do it for the steps that need it
MERGE_SHA: ${{ github.event.pull_request.merge_commit_sha }}
CHANGELOG_FILE: CHANGES.md
jobs:
publish:
if: >- # NOTE: Can't use top-level env here unfortunately
github.event.pull_request.merged == true &&
contains(github.event.pull_request.labels.*.name, 'release')
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout repo
uses: actions/checkout@v4
with:
ref: ${{ env.MERGE_SHA }}
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Get the version number
uses: cylc/release-actions/stage-2/get-version-from-pr@v1
- name: Build
uses: cylc/release-actions/build-python-package@v1
- name: Write release notes
id: release-notes
uses: MetRonnie/release-actions/stage-2/write-release-notes@changelog
with:
footer: |
Cylc 8 can be installed via pypi or Conda - you don't need to download this release directly.
See the [installation](https://cylc.github.io/cylc-doc/latest/html/installation.html) section of the documentation.
- name: Publish GitHub release
id: create-release
uses: cylc/release-actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
commitish: ${{ env.MERGE_SHA }}
tag_name: ${{ env.VERSION }}
release_name: cylc-flow-${{ env.VERSION }}
prerelease: ${{ env.PRERELEASE }}
body_path: ${{ steps.release-notes.outputs.filepath }}