forked from HuidaeCho/grass
-
Notifications
You must be signed in to change notification settings - Fork 0
93 lines (90 loc) · 3.28 KB
/
create_release_draft.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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
---
name: Create or check a release draft
on:
push:
branches:
- main
- releasebranch_*
tags:
- '**'
pull_request:
paths:
- .github/**
- utils/**
concurrency:
group: >-
${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
cancel-in-progress: true
env:
OUT_DIR: ${{ github.workspace }}/../grass_outdir
GRASS: grass-${{ github.ref_name }}
permissions: {}
jobs:
build:
name: Package and create release draft
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checks-out repository
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
ref: ${{ github.ref }}
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@39cd14951b08e74b54015e9e001cdefcf80e669f # v5.1.1
with:
python-version: '3.11'
- name: Create output directory
run: |
mkdir ${{ env.OUT_DIR }}
- name: Generate ChangeLog file
run: |
python utils/gitlog2changelog.py
mv ChangeLog ${{ env.OUT_DIR }}/ChangeLog
gzip ${{ env.OUT_DIR }}/ChangeLog
- name: Generate Git derived data files
run: |
echo "Generate VERSION_GIT file:"
./utils/generate_version_git_file.sh
cat include/VERSION_GIT
echo "Generate GENERATE_LAST_COMMIT_FILE:"
python utils/generate_last_commit_file.py .
cat core_modules_with_last_commit.json
echo "Create core modules patch file:"
git add core_modules_with_last_commit.json
git diff --cached > \
${{ env.OUT_DIR }}/core_modules_with_last_commit.patch
- name: Create tarballs (for tags only)
if: startsWith(github.ref, 'refs/tags/')
run: |
cd ..
tar -cvf ${{ env.OUT_DIR }}/${{ env.GRASS }}.tar \
--exclude=".gi*" --exclude=".tr*" grass
cd ${{ env.OUT_DIR }}
gzip -9k ${{ env.GRASS }}.tar
md5sum ${{ env.GRASS }}.tar.gz > ${{ env.GRASS }}.tar.gz.md5
sha256sum ${{ env.GRASS }}.tar.gz > ${{ env.GRASS }}.tar.gz.sha256
xz -9e ${{ env.GRASS }}.tar
md5sum ${{ env.GRASS }}.tar.xz > ${{ env.GRASS }}.tar.xz.md5
sha256sum ${{ env.GRASS }}.tar.xz > ${{ env.GRASS }}.tar.xz.sha256
- name: Publish draft distribution to GitHub (for tags only)
if: startsWith(github.ref, 'refs/tags/')
uses: softprops/action-gh-release@fb2d03176f42a1f0dd433ca263f314051d3edd44 # v2.0.7
with:
name: GRASS GIS ${{ github.ref_name }}
body: |
Overview of changes
- First change
- Second change
draft: true
prerelease: ${{ contains(github.ref, 'RC') }}
files: |
${{ env.OUT_DIR }}/${{ env.GRASS }}.tar.gz
${{ env.OUT_DIR }}/${{ env.GRASS }}.tar.gz.md5
${{ env.OUT_DIR }}/${{ env.GRASS }}.tar.gz.sha256
${{ env.OUT_DIR }}/${{ env.GRASS }}.tar.xz
${{ env.OUT_DIR }}/${{ env.GRASS }}.tar.xz.md5
${{ env.OUT_DIR }}/${{ env.GRASS }}.tar.xz.sha256
${{ env.OUT_DIR }}/ChangeLog.gz
${{ env.OUT_DIR }}/core_modules_with_last_commit.patch