-
Notifications
You must be signed in to change notification settings - Fork 0
54 lines (44 loc) · 1.63 KB
/
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
48
49
50
51
52
53
54
name: release
on:
push:
tags:
- v[0-9]*.[0-9]*.[0-9]*
env:
SKF_NAME: "${{ github.event.repository.name }}"
jobs:
skf-archive:
runs-on: ubuntu-latest
steps:
- name: Checkout sk set
uses: actions/checkout@v4
- name: Get version number
run: |
GIT_TAG=$(git describe --tags --match 'v[0-9]*.[0-9]*.[0-9]*')
SKF_VERSION=$(echo $GIT_TAG | sed -E 's/^v([0-9]+)\.([0-9])+\.([0-9]+)$/\1-\2/')
SKF_PATCH=$(echo $GIT_TAG | sed -E 's/^v([0-9]+)\.([0-9])+\.[0-9]+$/\3/')
echo "SKF_VERSION=${SKF_VERSION}" >> ${GITHUB_ENV}
echo "SKF_PATCH=${SKF_PATCH}" >> ${GITHUB_ENV}
echo "ARCHIVE_NAME=${SKF_NAME}-${SKF_VERSION}" >> ${GITHUB_ENV}
if [[ ${SKF_PATCH} -eq 0 ]]; then
echo RELEASE_NAME="${ARCHIVE_NAME}" >> ${GITHUB_ENV}
else
echo RELEASE_NAME="${ARCHIVE_NAME} (p${SKF_PATCH})" >> ${GITHUB_ENV}
fi
- name: Create archive
run: |
mkdir -p _build/${ARCHIVE_NAME}
cp $(find . -maxdepth 1 -not -type 'd') _build/${ARCHIVE_NAME}
cp -a skfiles/* _build/${ARCHIVE_NAME}
tar -C _build -c -v -J -f ${ARCHIVE_NAME}.tar.xz ${ARCHIVE_NAME}
mkdir -p _build/${ARCHIVE_NAME}-extras
cp -r extras/* _build/${ARCHIVE_NAME}-extras
tar -C _build -c -v -J -f ${ARCHIVE_NAME}-extras.tar.xz ${ARCHIVE_NAME}-extras
- name: Create release
uses: softprops/action-gh-release@v2
with:
name: ${{ env.RELEASE_NAME }}
preserve_order: True
files: |
${{ env.ARCHIVE_NAME }}.tar.xz
${{ env.ARCHIVE_NAME }}-extras.tar.xz
body_path: RELEASE.md