-
Notifications
You must be signed in to change notification settings - Fork 10
62 lines (51 loc) · 1.88 KB
/
release.yml
File metadata and controls
62 lines (51 loc) · 1.88 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
# .github/workflows/release.yml
name: Create Draft Release
on:
push:
tags:
- 'v*.*.*'
permissions:
contents: write
pull-requests: read
jobs:
release:
name: Create Draft Release
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '18'
- name: Install frontend dependencies
run: npm ci
working-directory: ./frontend
- name: Update manifest.json version
run: |
node -e "let manifest = require('./frontend/manifest.json'); manifest.version = '${{ github.ref_name }}'.substring(1); require('fs').writeFileSync('./frontend/manifest.json', JSON.stringify(manifest, null, 2));"
echo "frontend/manifest.json updated to version ${{ github.ref_name }}"
- name: Commit and Update Tag
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
git add frontend/manifest.json
git commit -m "chore: Bump frontend version to ${{ github.ref_name }}"
# This command updates the tag to point to the new commit
git push origin --force ${{ github.ref_name }}
- name: Build frontend extension
run: npm run build
working-directory: ./frontend
- name: Create ZIP archive
run: zip -r ../../CodeTranslateAI-${{ github.ref_name }}.zip .
working-directory: ./frontend/dist
- name: Create Draft GitHub Release
uses: softprops/action-gh-release@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}
tag_name: ${{ github.ref_name }}
draft: true
generate_release_notes: true
files: CodeTranslateAI-${{ github.ref_name }}.zip