-
Notifications
You must be signed in to change notification settings - Fork 9
66 lines (58 loc) · 2.03 KB
/
release.yml
File metadata and controls
66 lines (58 loc) · 2.03 KB
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
64
65
66
---
name: Release and Publish
on:
push:
tags:
- "v*.*.*"
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup python 🐍
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Install dependencies 👽
run: python -m pip install ansible-core yq rst-to-myst
- name: Verify release 🗒️
env:
TAG_NAME: ${{ github.ref_name }}
run: |
echo "::warning::TODO: confirm tests pass for this commit"
tag_version="${TAG_NAME##*v}"
version="$(yq -r .version galaxy.yml)"
if [[ ${tag_version} != ${version} ]]; then
echo "::error file=galaxy.yml::🔴 Tag version '${tag_version}' does not match galaxy.yml version '${version}'"
exit 1
fi
echo "::notice::🟢 Version number verified: '$version'"
- name: Build 🛠️
run: ansible-galaxy collection build -v --force .
- name: Prepare release notes 📓
env:
CHANGELOG_URL: "${{ format('{0}/{1}/blob/{2}/CHANGELOG.rst', github.server_url, github.repository, github.ref_name) }}"
REF_NAME: "${{ github.ref_name }}"
run: |
rst2myst stream --no-sphinx CHANGELOG.rst | csplit - "/^## ${REF_NAME}/" '/^## v.*/'
mv xx01 release_notes.md
echo "See also: [CHANGELOG](${CHANGELOG_URL}#${REF_NAME//./-})" >>release_notes.md
- name: Release 🛸
uses: softprops/action-gh-release@v2
with:
files: |
*.tar.gz
body_path: release_notes.md
fail_on_unmatched_files: true
generate_release_notes: true
publish:
needs: release
uses: ansible/ansible-content-actions/.github/workflows/release.yaml@main
with:
environment: release
secrets:
ah_token: ${{ secrets.AUTOMATION_HUB_API_KEY }}
ansible_galaxy_api_key: ${{ secrets.GALAXY_API_KEY }}
publish-docs:
needs: release
uses: ./.github/workflows/static.yml