-
Notifications
You must be signed in to change notification settings - Fork 5
/
action.yml
57 lines (49 loc) · 1.84 KB
/
action.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
name: "Upstream release"
description: "Perform an upstream GitHub release"
inputs:
token:
description: "A GitHub token for creating a release"
required: true
slack_webhook_url:
description: "A Slack incoming Webhook URL"
required: true
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
- name: Create GitHub release
# https://github.com/marketplace/actions/create-release
uses: ncipollo/[email protected]
with:
name: "${{ env.release_version }}"
token: "${{ inputs.TOKEN }}"
bodyFile: "release.md"
- name: Bump version
run: ${{ github.action_path }}/bump-version.sh "${{ env.release_version }}"
shell: bash
- name: Commit new version
# https://github.com/marketplace/actions/add-commit
uses: EndBug/add-and-commit@v7
with:
branch: main
message: "Post release version bump\n\n[skip ci]"
add: "-u *"
- name: Send release announcement to osbuild Slack channel
id: slack
uses: slackapi/[email protected]
with:
payload: "{\"blocks\":[{\"type\":\"section\",\"text\":{\"type\":\"mrkdwn\",\"text\":\"🚀 *<https://github.com/osbuild/${{ env.component }}/releases/tag/v${{ env.release_version }}|${{ env.component }} ${{ env.release_version }}>* just got released upstream! 🚀\"}}]}"
env:
SLACK_WEBHOOK_URL: ${{ inputs.SLACK_WEBHOOK_URL }}
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK