-
Notifications
You must be signed in to change notification settings - Fork 0
74 lines (63 loc) · 2.53 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
64
65
66
67
68
69
70
71
72
73
74
# Release product and their build aritfacts
#
# References:
#
# * Workflow syntax for GitHub Actions - GitHub Docs
# https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions
#
# Copyright 2024 林博仁(Buo-ren Lin) <[email protected]>
# SPDX-License-Identifier: CC-BY-SA-4.0
name: Release product and their build aritfacts
on:
push:
tags:
- v*.*.*
jobs:
release:
name: Release product and their build aritfacts
runs-on: ubuntu-20.04
steps:
- name: Check out content from the Git repository
uses: actions/checkout@v4
with:
# Increase fetch depth if you may have more than this amount
# of revisions between releases
fetch-depth: 100
# Fetch tags as well to generate detailed changes between two releases
# WORKAROUND: Adding this option triggers actions/checkout#1467
#fetch-tags: true
- name: >-
WORKAROUND: Fetch tags that points to the revisions
checked-out(actions/checkout#1467)
run: |-
git fetch \
--prune \
--prune-tags \
--force \
--depth=100 \
--no-recurse-submodules
- name: Determine the project identifier
run: printf "project_id=${GITHUB_REPOSITORY##*/}\\n" >> $GITHUB_ENV
- name: Determine the name of the Git tag
run: printf "release_tag=${GITHUB_REF##*/}\\n" >> $GITHUB_ENV
- name: Determine the release version string
run: printf "release_version=${release_tag#v}\\n" >> $GITHUB_ENV
- name: Determine the release identifier
run: printf "release_id=${project_id}-${release_version}\\n" >> $GITHUB_ENV
- name: >-
Patch the sudo security policy so that programs run via sudo
will recognize environment variables predefined by GitHub
run: sudo ./continuous-integration/patch-github-actions-sudo-security-policy.sh
- name: Generate the release archive
run: |-
sudo ./continuous-integration/generate-build-artifacts.install-system-deps.sh
./continuous-integration/generate-build-artifacts.sh
- name: Generate the release description
run: ./continuous-integration/generate-release-description.sh
- name: Publish the release archive to the GitHub Releases
uses: softprops/action-gh-release@v2
with:
name: ${{ env.project_id }} ${{ env.release_version }}
files: |
${{ env.release_id }}.tar*
body_path: .detailed_changes