-
Notifications
You must be signed in to change notification settings - Fork 0
82 lines (78 loc) · 2.55 KB
/
Copy pathrelease.yml
File metadata and controls
82 lines (78 loc) · 2.55 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
name: Release
on:
push:
tags:
- 'v*.*.*'
workflow_dispatch:
inputs:
version:
description: Semantic version without the v prefix
required: true
type: string
permissions:
contents: write
concurrency:
group: release-${{ github.ref }}
cancel-in-progress: false
jobs:
release:
name: Verify and publish release
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Checkout
uses: actions/checkout@v7
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: '3.13'
cache: pip
- name: Set up Node.js
uses: actions/setup-node@v7
with:
node-version-file: .nvmrc
package-manager-cache: true
- name: Install Python dependencies
run: python -m pip install --disable-pip-version-check --upgrade pip -r requirements.txt
- name: Install frontend dependencies
run: npm install --no-audit --no-fund
- name: Resolve release version
id: version
shell: bash
env:
INPUT_VERSION: ${{ inputs.version }}
run: |
if [[ "${GITHUB_REF_TYPE}" == "tag" ]]; then
VERSION="${GITHUB_REF_NAME#v}"
else
VERSION="${INPUT_VERSION}"
fi
if [[ ! "${VERSION}" =~ ^[0-9]+\.[0-9]+\.[0-9]+([+-][0-9A-Za-z.-]+)?$ ]]; then
echo "Invalid semantic version: ${VERSION}" >&2
exit 2
fi
echo "version=${VERSION}" >> "${GITHUB_OUTPUT}"
- name: Build verified release package
run: python scripts/release.py --version "${{ steps.version.outputs.version }}"
- name: Upload release package
uses: actions/upload-artifact@v7
with:
name: ygit-schema-${{ steps.version.outputs.version }}
path: |
release/ygit-schema-${{ steps.version.outputs.version }}.zip
release/ygit-schema-${{ steps.version.outputs.version }}.zip.sha256
if-no-files-found: error
retention-days: 90
- name: Publish GitHub release
if: github.ref_type == 'tag'
env:
GH_TOKEN: ${{ github.token }}
run: |
gh release create "${GITHUB_REF_NAME}" \
"release/ygit-schema-${{ steps.version.outputs.version }}.zip" \
"release/ygit-schema-${{ steps.version.outputs.version }}.zip.sha256" \
--verify-tag \
--generate-notes \
--title "YGit Schema ${{ steps.version.outputs.version }}"