admin_dashboard_react/.gitea/workflows/build.yaml
SnippetsX 3b3e675290
Some checks failed
Testing Example / build-and-test (push) Successful in 1m28s
Testing Example / publish-release (push) Failing after 16s
updated
2024-11-12 22:06:07 +03:00

55 lines
1.5 KiB
YAML

name: Testing Example
on:
push:
branches:
- master
jobs:
build-and-test:
runs-on: ubuntu-latest
steps:
- name: Check out repository code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: '22.0.x'
- name: Install dependencies
run: npm install
- name: Build app
run: npm run build
- name: Export version from metadata.json
run: |
VERSION=$(jq -r '"\(.buildMajor).\(.buildMinor).\(.buildRevision)-\(.buildTag)"' src/metadata.json)
echo "VERSION=$VERSION" >> $GITHUB_ENV
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: admin_dashboard-${{ env.VERSION }}
path: 'build'
if-no-files-found: error
retention-days: 5
publish-release:
needs: build-and-test
runs-on: ubuntu-latest
steps:
- name: Download artifact
uses: actions/download-artifact@v3
with:
name: admin_dashboard-${{ env.VERSION }}
path: build
- name: Create Release
uses: actions/create-release@v1
with:
path: build/admin_dashboard-${{ env.VERSION }}.zip
tag_name: v${{ env.VERSION }}
release_name: Release v${{ env.VERSION }}
draft: false
prerelease: ${{ contains(env.VERSION, 'DEV') || contains(env.VERSION, 'ALPHA') || contains(env.VERSION, 'BETA') }}