-
Notifications
You must be signed in to change notification settings - Fork 0
63 lines (53 loc) · 1.93 KB
/
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
59
60
61
62
63
---
name: Ansible collection release
on:
pull_request_target:
types:
- closed
jobs:
release:
if: |
github.event.pull_request.merged &&
!contains(github.event.pull_request.labels.*.name, 'skip_changelog')
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install tools
run: python -m pip install ansible-base antsibull-changelog --disable-pip-version-check
- name: Calculate next version
id: version
uses: gardar/version-drafter-action@event-triggers # Until PR gets merged: https://github.com/patrickjahns/version-drafter-action/pull/343
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Generate new version in changelog.yaml
run: antsibull-changelog release -v --version "${{ steps.version.outputs.next-version }}"
- name: Run antsichaut
uses: rndmh3ro/antsichaut-action@main
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
since_version: ${{ steps.version.outputs.current-version }}
- name: Update Changelog.rst
run: antsibull-changelog generate -v
- name: Update collection version
uses: mikefarah/yq@master
with:
cmd: yq -i '.version = "${{ steps.version.outputs.next-version }}"' 'galaxy.yml'
- name: Write changelog and version
uses: stefanzweifel/git-auto-commit-action@v4
with:
branch: ${{ github.event.pull_request.base.ref }}
commit_message: "chore: update version"
push_options: --force
- name: Checkout updated branch
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.base.ref }}
- name: Publish release
id: release-publish
uses: release-drafter/release-drafter@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}