-
Notifications
You must be signed in to change notification settings - Fork 10
63 lines (52 loc) · 1.84 KB
/
release.yml
File metadata and controls
63 lines (52 loc) · 1.84 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
# .github/workflows/release.yml
name: Create Draft Release
on:
push:
tags:
- 'v*.*.*'
- 'v*.*.*-*' # also handle pre-releases like v1.2.3-beta.1
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:
# Full history is required for the release notes generator
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 .github/scripts/update-manifest.js
- name: Commit and Update Tag
run: |
git config --global user.name 'CodeTranslate Release Bot'
git config --global user.email 'release-bot-codetranslate@users.noreply.github.com'
git add frontend/manifest.json
# This command updates the tag to point to the new commit
git commit -m "chore: bump manifest version to ${{ github.ref_name }} [skip ci]" || echo "No changes to commit"
git push origin HEAD:main
- 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
prerelease: ${{ contains(github.ref_name, '-') }}