Added new CI jobs for release automation
This commit is contained in:
59
.github/workflows/release.yml
vendored
Normal file
59
.github/workflows/release.yml
vendored
Normal file
@@ -0,0 +1,59 @@
|
|||||||
|
name: Release
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
tags:
|
||||||
|
- "v*.*.*"
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
package:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Install node
|
||||||
|
uses: actions/setup-node@v3
|
||||||
|
with:
|
||||||
|
node-version: '20'
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: |
|
||||||
|
cd client
|
||||||
|
npm ci
|
||||||
|
|
||||||
|
- name: Build
|
||||||
|
run: |
|
||||||
|
cd client
|
||||||
|
rm -f .env && echo "VITE_APIURL=/api/v1" > .env.production
|
||||||
|
npm run build
|
||||||
|
|
||||||
|
- name: Generate release info
|
||||||
|
run: |
|
||||||
|
echo '{
|
||||||
|
"project_name": "Spoolman",
|
||||||
|
"project_owner": "Donkie",
|
||||||
|
"version": "${{ github.ref_name }}"
|
||||||
|
}' > release_info.json
|
||||||
|
|
||||||
|
# Remove client source and keep only the built dist
|
||||||
|
- name: Clean
|
||||||
|
run: |
|
||||||
|
mv client/dist dist
|
||||||
|
rm -rf client
|
||||||
|
mkdir client
|
||||||
|
mv dist client/dist
|
||||||
|
|
||||||
|
- name: Zip
|
||||||
|
run: |
|
||||||
|
zip -r spoolman.zip *
|
||||||
|
|
||||||
|
- name: Create release and upload build
|
||||||
|
uses: softprops/action-gh-release@v1
|
||||||
|
id: create-release
|
||||||
|
with:
|
||||||
|
draft: true
|
||||||
|
name: ${{ github.ref_name }}
|
||||||
|
tag_name: ${{ github.ref_name }}
|
||||||
|
files: ./spoolman.zip
|
||||||
|
body: "⚠️ TODO ⚠️"
|
||||||
43
.github/workflows/trigger-release.yml
vendored
Normal file
43
.github/workflows/trigger-release.yml
vendored
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
name: Release Trigger
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
inputs:
|
||||||
|
bump:
|
||||||
|
type: choice
|
||||||
|
description: Version to bump
|
||||||
|
required: true
|
||||||
|
default: minor
|
||||||
|
options:
|
||||||
|
- micro
|
||||||
|
- minor
|
||||||
|
- major
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
bump-version:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Set up Python
|
||||||
|
uses: actions/setup-python@v4
|
||||||
|
with:
|
||||||
|
python-version: "3.9"
|
||||||
|
|
||||||
|
- name: Install node
|
||||||
|
uses: actions/setup-node@v3
|
||||||
|
with:
|
||||||
|
node-version: '20'
|
||||||
|
|
||||||
|
- name: Setup PDM
|
||||||
|
run: |
|
||||||
|
pip install pdm pdm-bump
|
||||||
|
|
||||||
|
- name: Bump version
|
||||||
|
run: |
|
||||||
|
pdm run bump ${{ github.event.inputs.bump }}
|
||||||
|
|
||||||
|
- name: Push
|
||||||
|
run: |
|
||||||
|
git push --follow-tags
|
||||||
Reference in New Issue
Block a user