forked from audacity/audacity
-
Notifications
You must be signed in to change notification settings - Fork 0
167 lines (157 loc) · 5.09 KB
/
package_linux.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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
name: Build Audacity Linux Packages
on:
push:
workflow_dispatch:
inputs:
build_level:
description: "Build level to be used. Valid values are: alpha, beta, release"
required: false
default: 'alpha'
type: string
build_type:
description: 'Build type. Valid values are: Debug, Release, RelWithDebInfo, MinSizeRel'
required: false
default: RelWithDebInfo
type: string
configuration_types:
description: 'Build type. Valid values are: Debug, Release, RelWithDebInfo, MinSizeRel or any combination separated with a semicolon'
required: false
default: RelWithDebInfo
type: string
cmake_options:
description: 'Additional CMake options for configuration'
required: false
default: ''
type: string
workflow_call:
inputs:
build_level:
description: "Build level to be used. Valid values are: alpha, beta, release"
required: false
default: 'alpha'
type: string
build_type:
description: 'Build type. Valid values are: Debug, Release, RelWithDebInfo, MinSizeRel'
required: false
default: RelWithDebInfo
type: string
cmake_options:
description: 'Additional CMake options for configuration'
required: false
default: ''
type: string
env:
BUILD_LEVEL: ${{ (inputs && inputs.build_level) || (github.event.inputs && github.event.inputs.build_level) || ((startsWith(github.ref, 'refs/heads/release-') && 'beta') || 'alpha') }}
BUILD_TYPE: ${{ (inputs && inputs.build_type) || (github.event.inputs && github.event.inputs.build_type) || 'Release' }}
CMAKE_OPTIONS: ${{ (inputs && inputs.cmake_options) || (github.event.inputs && github.event.inputs.cmake_options) || '' }}
OWNER: ${{ github.repository_owner }}
jobs:
generate_source_tarball:
name: Source Tarball
runs-on: ubuntu-20.04
steps:
- name: Checkout Audacity
uses: actions/checkout@v2
- name: Setup Dependencies
uses: audacity/audacity-actions/dependencies@v2
- name: Configure
uses: audacity/audacity-actions/configure@v2
with:
generator: Unix Makefiles
build_type: ${{ env.BUILD_TYPE }}
build_level: ${{ env.BUILD_LEVEL }}
cmake_options: ${{ env.CMAKE_OPTIONS }}
- name: Package
shell: bash
run: |
cmake --build .build.x64 --target package_source
- name: Upload sources
uses: actions/upload-artifact@v2
with:
name: audacity-sources
path: |
.build.x64/package/*
!.build.x64/package/_CPack_Packages
if-no-files-found: error
generate_docker_images:
name: Generate Docker Image (${{ matrix.config.name }})
strategy:
fail-fast: false
matrix:
config:
- name: arch-linux
dir: arch
- name: fedora-34
dir: fedora34
#- name: ubuntu-20.04
# dir: ubuntu-20.04
runs-on: ubuntu-22.04
permissions:
contents: read
packages: write
steps:
- name: Lowecase owner
shell: bash
run: |
OWNER=${{ github.repository_owner }}
echo "LOWERCASE_OWNER=${OWNER,,}" >> ${GITHUB_ENV}
- name: Checkout Audacity
uses: actions/checkout@v2
- name: Log in to the Container registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v3
with:
images: ghcr.io/${{ env.LOWERCASE_OWNER }}/audacity-${{ matrix.config.name }}-build
- name: Build and push Docker image
uses: docker/build-push-action@v2
with:
context: linux/packages/${{ matrix.config.dir }}
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build_package:
name: Build Package (${{ matrix.config.name }})
strategy:
fail-fast: false
matrix:
config:
- name: arch-linux
- name: fedora-34
#- name: ubuntu-20.04
needs: [generate_source_tarball, generate_docker_images]
runs-on: ubuntu-20.04
steps:
- uses: actions/download-artifact@v2
with:
path: .
- shell: bash
name: Perform build
run: |
ls -la .
mv -v audacity-sources/* .
rm -Rfv audacity-sources
deps=$(find -name "audacity-dependencies-*" -type d)
if [ ! -z "${deps}" ]
then
mv -v ${deps}/* .
rm -Rfv ${deps}
fi
chmod -v ga+w .
ls -la .
OWNER=${{ github.repository_owner }}
docker run --volume=$(pwd):/work_dir:rw --rm --network=none ghcr.io/${OWNER,,}/audacity-${{ matrix.config.name }}-build:${{ github.ref_name }}
- name: Upload Artifact
uses: actions/upload-artifact@v2
with:
name: ${{ matrix.config.name }}-package-${{ github.sha }}
path: |
**/*.rpm
**/*.deb
**/*.zst
if-no-files-found: error