Skip to content

rls

rls #136

Workflow file for this run

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/y2ai-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 > ./y2ai.tar.zst
- name: Calculating hash
run: |
sha="$(openssl sha256 ./y2ai.tar.zst | cut -d ' ' -f2)"
echo "shapart=${sha:0:2}-${sha:2:3}-${sha:5:3}-\
-${sha:8:2}-${sha:10:3}-${sha:13:3}" | tee -a "${GITHUB_ENV}"
- name: Releasing
env:
GH_TOKEN: ${{ github.token }}
run: |
[[ "${release}" == 'test' ]] && flag='-p'
gh release delete "${release}" --cleanup-tag -y || true
printf "SHA256 Part:\n\`${shapart}\`" \
| gh release create "${release}" ${flag} ./y2ai.tar.zst -F-