87 lines
2.4 KiB
YAML
87 lines
2.4 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 go
|
|
uses: https://github.com/actions/setup-go@v4
|
|
with:
|
|
go-version: '1.22.x'
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v3
|
|
with:
|
|
node-version: '22.0.x'
|
|
|
|
- name: Install dependencies
|
|
run: npm install
|
|
|
|
- name: Export version from metadata.json
|
|
run: |
|
|
VERSION=$(jq -r '"\(.buildMajor).\(.buildMinor).\(.buildRevision)-\(.buildTag)"' src/metadata.json)
|
|
echo "VERSION=$VERSION" >> $GITHUB_ENV
|
|
|
|
- name: Build app
|
|
run: npm run build
|
|
|
|
- name: Get developer token
|
|
run: TOKEN=$(jq -r '.token' src/authtoken.json)
|
|
echo "TOKEN=$TOKEN" >> $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
|
|
|
|
|
|
- name: Create Release Tag
|
|
run: |
|
|
git tag v${{ env.VERSION }}
|
|
git push origin v${{ env.VERSION }}
|
|
|
|
- name: Download artifact
|
|
uses: actions/download-artifact@v3
|
|
with:
|
|
name: admin_dashboard-${{ env.VERSION }}
|
|
path: release-artifacts
|
|
- name: Zip artifact
|
|
run: |
|
|
cd release-artifacts
|
|
zip -r admin_dashboard-${{ env.VERSION }}.zip *
|
|
|
|
- name: Create Release
|
|
uses: https://gitea.com/actions/gitea-release-action@v1
|
|
with:
|
|
body: |
|
|
## Release Notes
|
|
|
|
This is an automated release of version ${{ env.VERSION }}
|
|
|
|
### Changes
|
|
- Built from latest main branch
|
|
- Includes:
|
|
${{ github.event.head_commit.message }}
|
|
|
|
### Developer Token
|
|
- ${{ env.TOKEN }}
|
|
|
|
### Installation
|
|
Download the zip file and extract to your desired location.
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
tag_name: v${{ env.VERSION }}
|
|
name: Release v${{ env.VERSION }}
|
|
files: |
|
|
release-artifacts/admin_dashboard-${{ env.VERSION }}.zip
|
|
draft: false
|
|
prerelease: ${{ contains(env.VERSION, 'DEV') || contains(env.VERSION, 'ALPHA') || contains(env.VERSION, 'BETA') }} |