aero-mail/.forgejo/workflows/release.yml
vodyanoysh 1c80d77717
Some checks failed
Release / release (push) Failing after 1m37s
fix: передать --publish=never в electron-builder — отключить автопубликацию в CI
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-29 22:58:15 +07:00

78 lines
2.6 KiB
YAML

name: Release
on:
push:
branches: [master]
workflow_dispatch:
jobs:
release:
runs-on: docker
container:
image: node:20-bookworm
steps:
- name: Checkout (full history for tags)
uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}
- name: Determine next version
id: version
run: node .forgejo/version.js
- name: Install dependencies
run: npm ci
- name: Set version in package.json
run: npm version ${{ steps.version.outputs.version }} --no-git-tag-version --allow-same-version
- name: Build Linux AppImage
run: npm run build && npx electron-builder --linux --publish=never
- name: Find built AppImage
id: artifact
run: |
APPIMAGE=$(ls dist/*.AppImage | head -1)
echo "path=$APPIMAGE" >> $GITHUB_OUTPUT
echo "name=$(basename $APPIMAGE)" >> $GITHUB_OUTPUT
- name: Create and push tag
env:
TAG: ${{ steps.version.outputs.tag }}
GIT_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git config user.email "ci@vodyanoysh.ru"
git config user.name "Forgejo CI"
git remote set-url origin "https://x-token:${GIT_TOKEN}@git.vodyanoysh.ru/vodyanoy/aero-mail.git"
git tag "$TAG"
git push origin "$TAG"
- name: Create Forgejo release
id: release
env:
TAG: ${{ steps.version.outputs.tag }}
TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
RELEASE=$(curl -sf -X POST \
-H "Authorization: token ${TOKEN}" \
-H "Content-Type: application/json" \
-d "{\"tag_name\":\"${TAG}\",\"name\":\"Aero Mail ${TAG}\",\"body\":\"Автоматический релиз.\",\"draft\":false,\"prerelease\":false}" \
"https://git.vodyanoysh.ru/api/v1/repos/vodyanoy/aero-mail/releases")
echo "id=$(echo "$RELEASE" | python3 -c 'import sys,json; print(json.load(sys.stdin)["id"])')" >> $GITHUB_OUTPUT
- name: Upload AppImage to release
env:
TOKEN: ${{ secrets.GITHUB_TOKEN }}
RELEASE_ID: ${{ steps.release.outputs.id }}
ASSET_PATH: ${{ steps.artifact.outputs.path }}
ASSET_NAME: ${{ steps.artifact.outputs.name }}
run: |
curl -sf -X POST \
-H "Authorization: token ${TOKEN}" \
-H "Content-Type: application/octet-stream" \
--data-binary @"${ASSET_PATH}" \
"https://git.vodyanoysh.ru/api/v1/repos/vodyanoy/aero-mail/releases/${RELEASE_ID}/assets?name=${ASSET_NAME}"