-
Notifications
You must be signed in to change notification settings - Fork 8
44 lines (39 loc) · 1.46 KB
/
package-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
name: Create source package for release
# Needing this, because wlmaker uses submodules, and github source package
# creation will not include submodules -- and cannot be tuned for that.
# See: https://github.com/phkaeser/wlmaker/issues/133
on:
push:
branches:
- main
tags:
- v*
release:
types:
- published
jobs:
release:
name: Create Release
runs-on: ubuntu-latest
steps:
- name: Checkout code, including required submodules.
uses: actions/checkout@v3
with:
# Not using 'recursive' prevents fetching extra submodules below
# dependencies/. These are only needed to build wlroots from source.
submodules: true
- name: Create source package.
run: |
export WLM_VERSION="$(echo "${{ github.ref }}" | sed "s/^refs\/tags\/v//")"
# Setup folder with package name, for apprropriate unpacking.
rm -rf "/tmp/wlmaker-${WLM_VERSION}"
cp -a "${PWD}" "/tmp/wlmaker-${WLM_VERSION}"
mv "/tmp/wlmaker-${WLM_VERSION}" .
tar -zcvf "wlmaker-${WLM_VERSION}.tar.gz" "wlmaker-${WLM_VERSION}"
echo "WLM_ARCHIVE=wlmaker-${WLM_VERSION}.tar.gz" >> "${GITHUB_ENV}"
echo "Created source archive wlmaker-${WLM_VERSION}.tar.gz."
- name: Upload source package.
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: ${{env.WLM_ARCHIVE}}