Skip to content

Update release.yml

Update release.yml #6

Workflow file for this run

name: Release
on:
push:
#tags:
# - 'v*'
jobs:
push-to-eltos-typst-packages:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
path: accelerated-jacow
- uses: actions/checkout@v4
with:
repository: eltos/typst-packages
path: typst-packages
- name: Extract version
run: |
VERSION=$(awk -F'= *' '/^version/{gsub(/"/,"",$2);print $2}' accelerated-jacow/typst.toml)
echo "VERSION=$VERSION" >> "$GITHUB_ENV"
- name: Copy & commit
run: |
# Copy
cd typst-packages
git branch -D accelerated-jacow-$VERSION 2>/dev/null || true
git checkout -b accelerated-jacow-$VERSION
mkdir -p packages/preview/accelerated-jacow/$VERSION
rm -drf packages/preview/accelerated-jacow/$VERSION/*
cp -r ../accelerated-jacow/* packages/preview/accelerated-jacow/$VERSION/
ls -l packages/preview/accelerated-jacow/$VERSION/
# Commit
git config user.name "Eltos"
git config user.email "[email protected]"
git add packages/preview/accelerated-jacow/$VERSION/
git commit -m "accelerated-jacow:$VERSION"
- name: Push
run: |
# Setup SSH
mkdir -p ~/.ssh
echo "{{ secrets.ELTOS_TYPST_PACKAGES_DEPLOY_KEY }}" > ~/.ssh/id_ed25519
chmod 600 ~/.ssh/id_ed25519
ssh-keyscan github.com >> ~/.ssh/known_hosts
# Push
cd typst-packages
git config --unset-all http.https://github.com/.extraheader
git config push.autoSetupRemote true
git push --force