feat: Bootstrap the Electron application with React, Convex, and LiveKit, including a FriendsView component and a Gitea CI/CD release workflow.
Some checks failed
Build and Release / build-and-release (push) Failing after 27m21s
Some checks failed
Build and Release / build-and-release (push) Failing after 27m21s
This commit is contained in:
87
.gitea/workflows/release.yml
Normal file
87
.gitea/workflows/release.yml
Normal file
@@ -0,0 +1,87 @@
|
||||
name: Build and Release
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
|
||||
jobs:
|
||||
build-and-release:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 20
|
||||
|
||||
- name: Install Wine (for Windows cross-compile)
|
||||
run: |
|
||||
sudo dpkg --add-architecture i386
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y wine64 wine32
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
npm install
|
||||
npm run install:frontend
|
||||
|
||||
- name: Read version from package.json
|
||||
id: version
|
||||
run: |
|
||||
VERSION=$(node -p "require('./FrontEnd/Electron/package.json').version")
|
||||
echo "version=$VERSION" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Build Electron app
|
||||
run: |
|
||||
cd FrontEnd/Electron
|
||||
npm run build
|
||||
npx electron-builder --linux --win
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.CI_TOKEN }}
|
||||
|
||||
- name: Delete existing latest release
|
||||
run: |
|
||||
RELEASE_ID=$(curl -s -H "Authorization: token $TOKEN" \
|
||||
"$GITEA_URL/api/v1/repos/$REPO/releases/tags/latest" | jq -r '.id')
|
||||
if [ "$RELEASE_ID" != "null" ] && [ -n "$RELEASE_ID" ]; then
|
||||
curl -X DELETE -H "Authorization: token $TOKEN" \
|
||||
"$GITEA_URL/api/v1/repos/$REPO/releases/$RELEASE_ID"
|
||||
# Also delete the tag so it can be recreated
|
||||
curl -X DELETE -H "Authorization: token $TOKEN" \
|
||||
"$GITEA_URL/api/v1/repos/$REPO/tags/latest"
|
||||
fi
|
||||
env:
|
||||
GITEA_URL: ${{ secrets.CI_URL }}
|
||||
REPO: ${{ gitea.repository }}
|
||||
TOKEN: ${{ secrets.CI_TOKEN }}
|
||||
|
||||
- name: Create release and upload artifacts
|
||||
run: |
|
||||
VERSION="${{ steps.version.outputs.version }}"
|
||||
|
||||
# Create new release with latest tag
|
||||
RELEASE_ID=$(curl -s -X POST -H "Authorization: token $TOKEN" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d "{\"tag_name\":\"latest\",\"name\":\"v${VERSION}\",\"body\":\"Auto-release v${VERSION} from CI\"}" \
|
||||
"$GITEA_URL/api/v1/repos/$REPO/releases" | jq -r '.id')
|
||||
|
||||
echo "Created release ID: $RELEASE_ID"
|
||||
|
||||
# Upload each artifact
|
||||
for file in FrontEnd/Electron/dist/latest*.yml \
|
||||
FrontEnd/Electron/dist/*.exe \
|
||||
FrontEnd/Electron/dist/*.exe.blockmap \
|
||||
FrontEnd/Electron/dist/*.AppImage; do
|
||||
[ -f "$file" ] || continue
|
||||
FILENAME=$(basename "$file")
|
||||
echo "Uploading: $FILENAME"
|
||||
curl -X POST -H "Authorization: token $TOKEN" \
|
||||
-F "attachment=@$file" \
|
||||
"$GITEA_URL/api/v1/repos/$REPO/releases/$RELEASE_ID/assets?name=$FILENAME"
|
||||
done
|
||||
env:
|
||||
GITEA_URL: ${{ secrets.CI_URL }}
|
||||
REPO: ${{ gitea.repository }}
|
||||
TOKEN: ${{ secrets.CI_TOKEN }}
|
||||
Reference in New Issue
Block a user