-
Notifications
You must be signed in to change notification settings - Fork 1
113 lines (97 loc) · 3.28 KB
/
release.lazarus.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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
name: Lazarus Release Workflow
defaults:
run:
shell: bash
on:
workflow_call:
inputs:
config:
description: A JSON object containing configuration values
required: true
type: string
fail-fast:
description: Fail Fast on the jobs
required: true
type: boolean
jobs:
release-app:
name: release [${{ fromJSON(inputs.config).tag }}]
runs-on: ubuntu-latest
strategy:
fail-fast: ${{ inputs.fail-fast }}
steps:
- name: Build env from inputs.config
run: |
(
echo "app-name=${{ fromJSON(inputs.config).app-name }}"
echo "tag=${{ fromJSON(inputs.config).tag }}"
echo "cliff-cfg=${{ fromJSON(inputs.config).cliff-cfg }}"
echo "win=${{ fromJSON(inputs.config).win }}"
echo "lin=${{ fromJSON(inputs.config).lin }}"
echo "osx=${{ fromJSON(inputs.config).osx }}"
) >> "$GITHUB_ENV"
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
submodules: true
- name: Download the Release binaries
uses: actions/download-artifact@v4
- name: List files
run: |
ls -alF "${{ env.lin }}"
ls -alF "${{ env.win }}"
ls -alF "${{ env.osx }}"
- name: Create release archive
run: |
if [ "${{ env.lin }}" != "" ]; then
cd "${{ env.lin }}"
chmod +x "${{ env.app-name }}"
tar -zcvf "../${{ env.lin }}-${{ env.tag }}.tgz" *
cd ..
fi
if [ "${{ env.win }}" != "" ]; then
cd "${{ env.win }}"
zip "../${{ env.win }}-${{ env.tag }}.zip" *
cd ..
fi
if [ "${{ env.osx }}" != "" ]; then
cd "${{ env.osx }}"
chmod +x "${{ env.app-name }}"
tar -zcvf "../${{ env.osx }}-${{ env.tag }}.tgz" *
cd ..
fi
- name: Generate Release Notes
id: git-cliff
uses: orhun/git-cliff-action@v2
with:
config: ${{ env.cliff-cfg }}
args: --latest --strip header
env:
OUTPUT: CHANGES.md
- name: Create GitHub release
uses: softprops/action-gh-release@v1
with:
name: Lazarus ${{ env.app-name }} ${{ env.tag }}
body: ${{ steps.git-cliff.outputs.content }}
files: |
*.tgz
*.zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# - name: Print some values
# run: |
# echo Config: ${{ inputs.config }}
# echo Tag: ${{ env.tag }}
# echo GitHub Ref: ${{ github.ref }}
# echo GitHub Ref Name: ${{ github.ref_name }}
# echo GitHub Ref Type: ${{ github.ref_type }}
# echo GitHub Event Name: ${{ github.event_name }}
# echo GitHub Event Path: ${{ github.event_path }}
# echo Tag: ${{ env.tag }}
# echo Win Bin: ${{ env.win }}/${{ env.app-name }}.exe
# echo Lin Bin: ${{ env.lin }}/${{ env.app-name }}
# echo OSX Bin: ${{ env.osx }}/${{ env.app-name }}
# echo zip win: ../${{ env.win }}-${{ env.tag }}.zip
# echo tgz lin: ../${{ env.lin }}-${{ env.tag }}.tgz
# echo tgz osx: ../${{ env.osx }}-${{ env.tag }}.tgz