-
Notifications
You must be signed in to change notification settings - Fork 4
61 lines (52 loc) · 1.93 KB
/
github-release.yaml
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
---
# SPDX-License-Identifier: Apache-2.0
# SPDX-FileCopyrightText: 2024 The Linux Foundation <https://linuxfoundation.org>
name: "📦 Release to GitHub"
# Packages a development/production release on GitHub"
on:
workflow_call:
inputs:
PRE_RELEASE:
description: "Mark release as pre-release/development version"
type: string
required: false
default: false
BUILD_TAG:
description: "Semantic tag for this release/build"
type: string
required: true
jobs:
github-release:
name: "GitHub Release"
runs-on: "ubuntu-latest"
permissions:
contents: write
steps:
- name: "Checkout repository"
uses: actions/checkout@v4
- name: "Extract project/repository naming"
id: naming
# yamllint disable-line rule:line-length
uses: os-climate/osc-github-devops/.github/actions/python-project-name@main
- name: "⬇ Download build artefacts"
uses: actions/download-artifact@v4
with:
name: ${{ env.python_project_name }}-${{ inputs.build_tag }}
path: ${{ env.BUILD_ARTEFACTS }}
- name: "Check project version matches pushed tags"
if: startsWith(github.ref, 'refs/tags/')
uses: os-climate/osc-github-devops/.github/actions/python-project-version-vs-tag@main
- name: "Create GitHub release"
uses: softprops/action-gh-release@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}
prerelease: ${{ inputs.PRE_RELEASE }}
tag_name: ${{ inputs.build_tag }}
name: "${{ env.python_project_name }} ${{ inputs.build_tag }}"
# ToDo: Incorporate release notes, etc.
# body_path: ${{ github.workspace }}/CHANGELOG.rst
files: |
${{ env.BUILD_ARTEFACTS }}/*.tar.gz
${{ env.BUILD_ARTEFACTS }}/*.whl
${{ env.BUILD_ARTEFACTS }}/*.zip
${{ env.BUILD_ARTEFACTS }}/*.sigstore*