-
Notifications
You must be signed in to change notification settings - Fork 0
41 lines (35 loc) · 1.14 KB
/
rls.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
name: rls
on: workflow_dispatch
permissions:
contents: write
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Installing `libarchive-tools`
run: |
sudo apt-get update
sudo apt-get install libarchive-tools
- name: Writing the variables
run: |
rfile='./cfg/njk-release'
date +'release-time=%s' >> "${rfile}"
cat "${rfile}" | tee -a "${GITHUB_ENV}"
- name: Compressing
run: |
bsdtar \
--exclude-vcs --exclude=./{.github/,README.md} \
-b1 -cv ./* \
| zstd -T0 --ultra -20zvc > ./njki
- name: Releasing
env:
GH_TOKEN: ${{ github.token }}
run: |
sha="$(openssl sha256 ./njki | cut -d ' ' -f2)"
shapart="${sha:0:2}-${sha:2:3}-${sha:5:3}--${sha:8:2}-${sha:10:3}-${sha:13:3}"
[[ "${release}" == 'test' ]] && flag='-p'
gh release delete "${release}" --cleanup-tag -y || true
echo -e "SHA256 Part:\n\`${shapart}\`" \
| gh release create "${release}" ${flag} ./njki -F-