Skip to content

CI: Update usage of deprecated set-output #25

CI: Update usage of deprecated set-output

CI: Update usage of deprecated set-output #25

Workflow file for this run

name: Build Decompilation Guide
on: push
permissions:
contents: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Typst
uses: lvignoli/typst-action@main
with:
source_file: src/main.typ
- name: Upload PDF file
uses: actions/upload-artifact@v4
with:
name: PDF
path: src/main.pdf
- name: Get current date for release
id: date
if: github.ref_type == 'tag'
run: echo "date=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT
- name: Format tag for release
id: format_tag
if: github.ref_type == 'tag'
env:
TAG_NAME: ${{ github.ref_name }}
run: |
TAG="$TAG_NAME"
# normalize separators to spaces
TAG="${TAG//_/ }"
TAG="${TAG//-/ }"
# split and capitalize each word
read -ra parts <<< "$TAG"
pretty=""
for w in "${parts[@]}"; do
if [[ -z "$w" ]]; then continue; fi
first="${w:0:1}"
rest="${w:1}"
pretty+="${first^^}${rest} "
done
pretty="${pretty% }"
echo "formatted tag: '$pretty'"
echo "pretty=$pretty" >> $GITHUB_OUTPUT
- name: Create release
uses: softprops/action-gh-release@v1
if: github.ref_type == 'tag'
with:
name: "${{ steps.format_tag.outputs.pretty }} — ${{ steps.date.outputs.date }}"
files: src/main.pdf