-
Notifications
You must be signed in to change notification settings - Fork 4
58 lines (45 loc) · 1.49 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
55
56
name: release
on:
push:
tags:
- "v[0-9]*-[0-9]*"
env:
SKF_SET_NAME: "${{ github.event.repository.name }}"
jobs:
skf-archive:
runs-on: ubuntu-latest
steps:
- name: Checkout sk set
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Get version number
run: |
GIT_TAG=$(git describe --tags --match 'v[0-9]*-[0-9]*')
SKF_SET_VERSION=${GIT_TAG#v}"
echo "SKF_SET_VERSION=${SKF_SET_VERSION} >> ${GITHUB_ENV}
echo "ARCHIVE_NAME=${SKF_SET_NAME}-${SKF_SET_VERSION}" >> ${GITHUB_ENV}
- name: Create archive
run: |
mkdir -p _build/${ARCHIVE_NAME}
cp $(find . -maxdepth 1 -not -type 'd') _build/${ARCHIVE_NAME}
cp skfiles/*.skf _build/${ARCHIVE_NAME}
cp extras/{spinw.hsd,wfc.hsd} _build/${ARCHIVE_NAME}
tar -C _build -c -v -J -f ${ARCHIVE_NAME}.tar.xz ${ARCHIVE_NAME}
cp extras/spinw.hsd ${ARCHIVE_NAME}.spinw.hsd
cp extras/wfc.hsd ${ARCHIVE_NAME}.wfc.hsd
- name: Upload archive
uses: actions/upload-artifact@v4
with:
name: ${{ env.ARCHIVE_NAME }}.tar.xz
path: ${{ env.ARCHIVE_NAME }}.tar.xz
- name: Create release
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/v')
with:
# name: ${{ env.ARCHIVE_NAME }}
files: |
${{ env.ARCHIVE_NAME }}.tar.xz
${{ env.ARCHIVE_NAME }}.spinw.hsd
${{ env.ARCHIVE_NAME }}.wfc.hsd
body_path: README.md