-
Notifications
You must be signed in to change notification settings - Fork 10
94 lines (73 loc) · 2.46 KB
/
Copy pathrelease.yaml
File metadata and controls
94 lines (73 loc) · 2.46 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
name: GitHub Release
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
on:
pull_request:
push:
branches:
- "trunk-*"
tags:
- "v*"
workflow_dispatch:
env:
name: gsd
defaults:
run:
shell: bash
jobs:
release:
name: Build release tarball
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
fetch-depth: 0
submodules: true
path: code
- name: Install tools
run: sudo apt-get install pcregrep pandoc
- name: Determine last tag via git describe
if: ${{ ! startsWith(github.ref, 'refs/tags/v') }}
run: echo tag="$(git describe --abbrev=0)" >> "$GITHUB_ENV"
working-directory: code
# git describe does not return the current tag in tag pushes on GitHub Actions, use GITHUB_REF instead
- name: Determine tag from GITHUB_REF
if: startsWith(github.ref, 'refs/tags/v')
run: echo tag="$(echo "${GITHUB_REF}" | sed -e 's/refs\/tags\///g')" >> "$GITHUB_ENV"
- name: Write version change log
run: .github/workflows/make-changelog-md.sh "${tag:1}" | tee "${GITHUB_WORKSPACE}/changelog.md"
working-directory: code
- name: Copy source
run: cp -R code "${name}-${tag:1}"
- name: Remove .git
run: rm -rf "${name}-${tag:1}/.git" && ls -laR "${name}-${tag:1}"
- name: Tar source
run: tar -cvzf "${name}-${tag:1}.tar.gz" "${name}-${tag:1}"
- name: Tar source
run: tar -cvJf "${name}-${tag:1}.tar.xz" "${name}-${tag:1}"
- name: Tar source
run: tar --zstd -cvf "${name}-${tag:1}.tar.xz" "${name}-${tag:1}"
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: release
path: |
*.tar.*
changelog.md
publish:
name: Publish [GitHub]
needs: [release]
runs-on: ubuntu-latest
steps:
- name: Download artifacts
uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0
with:
name: release
- name: Create release
uses: softprops/action-gh-release@6cbd405e2c4e67a21c47fa9e383d020e4e28b836 # v2.3.3
if: startsWith(github.ref, 'refs/tags/v')
with:
files: "*.tar.*"
body_path: changelog.md
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}