-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathaction.yml
More file actions
100 lines (89 loc) · 3.11 KB
/
Copy pathaction.yml
File metadata and controls
100 lines (89 loc) · 3.11 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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
name: "Upstream release"
description: "Perform an upstream GitHub release"
inputs:
token:
description: "A GitHub token for creating a release"
required: true
slack_bot_token:
description: "A Slack bot OAuth token"
required: true
branch:
description: "Branch to commit the version bump to"
required: false
default: 'main'
tag:
description: "The tag to release. Required for workflow_dispatch triggers where GITHUB_REF is a branch, not a tag."
required: false
semver:
description: "Use semantic versioning for the post-release version bump"
required: false
default: 'false'
semver_bump_type:
description: "The type of semantic versioning bump to perform: 'major', 'minor', or 'patch'"
required: false
default: 'patch'
build_release_artifacts:
description: "Run `make release_artifacts` and expect results in `release_artifacts/`"
required: false
default: 'false'
runs:
using: "composite"
steps:
- name: Checkout current repo
uses: actions/checkout@v2
with:
token: "${{ inputs.TOKEN }}"
fetch-depth: 0
- name: Fetch all tags
# GitHub's checkout action doesn't properly fetch the current tag
run: git fetch --tags --prune --force
shell: bash
- name: Generate release information
run: ${{ github.action_path }}/release-info.sh
shell: bash
env:
INPUT_TAG: ${{ inputs.tag }}
- name: Build additional release artifacts (optionally)
run: make release_artifacts
shell: bash
if: ${{ inputs.build_release_artifacts == 'true' }}
- name: Create GitHub release
# https://github.com/marketplace/actions/create-release
uses: ncipollo/release-action@v1.14.0
with:
tag: ${{ inputs.tag }}
name: "${{ env.release_version }}"
token: "${{ inputs.TOKEN }}"
bodyFile: "release.md"
artifacts: "release_artifacts/*"
- name: Bump version
run: |
if [[ "${{ inputs.semver }}" == "true" ]]; then
${{ github.action_path }}/bump-version.sh "${{ env.release_version }}" "${{ inputs.semver_bump_type }}"
else
${{ github.action_path }}/bump-version.sh "${{ env.release_version }}"
fi
shell: bash
- name: Commit new version
# https://github.com/marketplace/actions/add-commit
uses: EndBug/add-and-commit@v7
with:
branch: ${{ inputs.branch }}
message: "Post release version bump\n\n[skip ci]"
add: "-u *"
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Install Python dependencies
run: pip install -r ${{ github.action_path }}/requirements.txt
shell: bash
- name: Send release announcement to osbuild Slack channel
run: |
python3 ${{ github.action_path }}/slack_notify_release.py \
--component "${{ env.component }}" \
--version "${{ env.release_version }}" \
--release-notes-file "release.md" \
--slack-bot-token "${{ inputs.slack_bot_token }}" \
--slack-channel-id "C0235DZB0DT"
shell: bash