notepad/.gitea/workflows/release.yaml
Workflow config file is invalid. Please check your config file: yaml: line 51: could not find expected ':'

125 lines
4.6 KiB
YAML

name: Release
on:
push:
tags:
- 'v*'
jobs:
release:
runs-on: ubuntu-gitea
steps:
- name: Prep For Local Builds
run: echo "${LOCIP} gitea.comnenos" >> /etc/hosts
- uses: actions/checkout@v4
- name: Install Build Dependencies
run: |
apt update
apt -y --no-install-recommends install \
wget \
file \
fuse \
libfuse2 \
python3 \
python3-pip
- name: Install .NET SDK
run: |
wget https://dot.net/v1/dotnet-install.sh -O dotnet-install.sh
chmod +x dotnet-install.sh
./dotnet-install.sh --channel 8.0 --install-dir /usr/local/dotnet
ln -sf /usr/local/dotnet/dotnet /usr/bin/dotnet
- name: Setup FUSE and AppImageTool
run: |
# Install and load FUSE
modprobe fuse || echo "Warning: Could not load fuse module"
# Download and extract appimagetool without FUSE (using --appimage-extract)
wget https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage \
-O appimagetool.AppImage
chmod +x appimagetool.AppImage
./appimagetool.AppImage --appimage-extract
# Create wrapper script that uses extracted version
cat > /usr/local/bin/appimagetool << 'EOF'
#!/bin/bash
/workspace/gmgauthier/notepad/squashfs-root/AppRun "$@"
EOF
chmod +x /usr/local/bin/appimagetool
- name: Build Linux Packages
run: |
cd NotePad
python3 publish.py linux both
- name: Create Release Archive
run: |
VERSION=${GITHUB_REF#refs/tags/}
mkdir -p release
# Copy AppImage (if it exists)
if [ -f publish/appimage/NotePad-0.1.0-x86_64.AppImage ]; then
cp publish/appimage/NotePad-0.1.0-x86_64.AppImage \
release/NotePad-${VERSION}-x86_64.AppImage
fi
# Copy Tarball
cp publish/tarball/notepad-0.1.0-linux-x64.tar.gz \
release/notepad-${VERSION}-linux-x64.tar.gz
# Generate checksums
cd release
if [ -f NotePad-${VERSION}-x86_64.AppImage ]; then
sha256sum NotePad-${VERSION}-x86_64.AppImage > NotePad-${VERSION}-x86_64.AppImage.sha256
fi
sha256sum notepad-${VERSION}-linux-x64.tar.gz > notepad-${VERSION}-linux-x64.tar.gz.sha256
ls -lh # For debugging
- name: Create Release
env:
GITEA_TOKEN: ${{ secrets.RELEASE_TOKEN }}
run: |
VERSION=${GITHUB_REF#refs/tags/}
# Create release
curl -X POST "https://repos.gmgauthier.com/api/v1/repos/${GITHUB_REPOSITORY}/releases" \
-H "Authorization: token ${GITEA_TOKEN}" \
-H "Content-Type: application/json" \
-d "{
\"tag_name\": \"${VERSION}\",
\"name\": \"NotePad ${VERSION}\",
\"body\": \"Release ${VERSION}\n\n## Linux Downloads\n- **AppImage**: Portable, single-file executable (no installation needed)\n- **Tarball**: Extract and run \`sudo ./install.sh\` to install\"
}" > release_response.json
RELEASE_ID=$(cat release_response.json | grep -o '"id":[0-9]*' | head -1 | cut -d':' -f2)
# Upload AppImage if it exists
if [ -f release/NotePad-${VERSION}-x86_64.AppImage ]; then
curl -X POST "https://repos.gmgauthier.com/api/v1/repos/${GITHUB_REPOSITORY}/releases/${RELEASE_ID}/assets?name=NotePad-${VERSION}-x86_64.AppImage" \
-H "Authorization: token ${GITEA_TOKEN}" \
-H "Content-Type: application/octet-stream" \
--data-binary @release/NotePad-${VERSION}-x86_64.AppImage
curl -X POST "https://repos.gmgauthier.com/api/v1/repos/${GITHUB_REPOSITORY}/releases/${RELEASE_ID}/assets?name=NotePad-${VERSION}-x86_64.AppImage.sha256" \
-H "Authorization: token ${GITEA_TOKEN}" \
-H "Content-Type: text/plain" \
--data-binary @release/NotePad-${VERSION}-x86_64.AppImage.sha256
fi
# Upload tarball
curl -X POST "https://repos.gmgauthier.com/api/v1/repos/${GITHUB_REPOSITORY}/releases/${RELEASE_ID}/assets?name=notepad-${VERSION}-linux-x64.tar.gz" \
-H "Authorization: token ${GITEA_TOKEN}" \
-H "Content-Type: application/gzip" \
--data-binary @release/notepad-${VERSION}-linux-x64.tar.gz
# Upload tarball checksum
curl -X POST "https://repos.gmgauthier.com/api/v1/repos/${GITHUB_REPOSITORY}/releases/${RELEASE_ID}/assets?name=notepad-${VERSION}-linux-x64.tar.gz.sha256" \
-H "Authorization: token ${GITEA_TOKEN}" \
-H "Content-Type: text/plain" \
--data-binary @release/notepad-${VERSION}-linux-x64.tar.gz.sha256