-
Notifications
You must be signed in to change notification settings - Fork 8
47 lines (41 loc) · 1.45 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
45
46
47
name: Create source package for release
on:
push:
branches:
- package-release
- 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: Setup environment.
run: |
tag_or_branch="${GITHUB_REF#refs/tags/}"
tag_or_branch="${tag_or_branch#refs/heads/}"
echo "WLM_RELEASE_NAME=wlmaker-$(echo $tag_or_branch | sed "s/^v//")" >> "$GITHUB_ENV"
echo "WLM_RELEASE_FILE=wlmaker-$(echo $tag_or_branch | sed "s/^v//").tar.gz" >> "$GITHUB_ENV"
- name: Create source package.
run: |
# Setup folder with package name, for apprropriate unpacking.
rm -rf "/tmp/${WLM_RELEASE_NAME}"
cp -a "${PWD}" "/tmp/${WLM_RELEASE_NAME}"
mv "/tmp/${WLM_RELEASE_NAME}" .
tar -zcvf "${WLM_RELEASE_FILE}" "${WLM_RELEASE_NAME}"
echo "Created source archive ${WLM_RELEASE_FILE}."
- name: Upload source package.
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: ${{env.WLM_RELEASE_FILE}}