mirror of
https://github.com/imgfloat/client.git
synced 2026-02-05 03:59:26 +00:00
Migrate from personal repo
This commit is contained in:
47
.github/workflows/ci.yml
vendored
Normal file
47
.github/workflows/ci.yml
vendored
Normal file
@@ -0,0 +1,47 @@
|
||||
name: Electron CI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: ['**']
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
build:
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ubuntu-latest, windows-latest, macos-latest]
|
||||
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
lfs: true
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 20
|
||||
- run: npm ci
|
||||
- name: Check version tag
|
||||
id: version_guard
|
||||
if: github.ref == 'refs/heads/master'
|
||||
shell: bash
|
||||
run: |
|
||||
VERSION=$(node -p "require('./package.json').version")
|
||||
echo "version=$VERSION" >> $GITHUB_OUTPUT
|
||||
|
||||
if git rev-parse "v$VERSION" >/dev/null 2>&1; then
|
||||
echo "exists=true" >> $GITHUB_OUTPUT
|
||||
else
|
||||
echo "exists=false" >> $GITHUB_OUTPUT
|
||||
fi
|
||||
- name: Build (no publish)
|
||||
if: github.ref != 'refs/heads/master'
|
||||
run: npx electron-builder --publish=never
|
||||
- name: Build & publish
|
||||
if: github.ref == 'refs/heads/master' && steps.version_guard.outputs.exists == 'false'
|
||||
run: npx electron-builder --publish=always
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
- name: Publish skipped
|
||||
if: github.ref == 'refs/heads/master' && steps.version_guard.outputs.exists == 'true'
|
||||
run: echo "Version already released — skipping publish"
|
||||
Reference in New Issue
Block a user