-
-
Notifications
You must be signed in to change notification settings - Fork 2
79 lines (68 loc) · 2.74 KB
/
cd.yml
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
name: CD
# **What it does**: Automatically generates releases and release notes.
# **Why we have it**: Allows development to focus on higher value work.
on:
push:
branches:
- main
# Allows this workflow to be run manually from the Actions tab
workflow_dispatch:
permissions:
contents: write
pull-requests: write
jobs:
release:
name: Create/Update Release Pull Request
runs-on: ubuntu-latest
outputs:
release_created: ${{ steps.release.outputs.release_created }}
tag_name: ${{ steps.release.outputs.tag_name }}
upload_url: ${{ steps.release.outputs.upload_url }}
steps:
- name: Release Please
id: release
uses: googleapis/release-please-action@v4
with:
config-file: .github/release-please/config.json
manifest-file: .github/release-please/manifest.json
assets:
name: Create and Upload Release Asset
needs: release
if: needs.release.outputs.release_created == 'true'
runs-on: ubuntu-latest
steps:
- name: Check out repo
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Setup Node
uses: actions/setup-node@v4
with:
cache: npm
check-latest: true
node-version: lts/*
- name: Install
run: npm ci --ignore-scripts
- name: Build
run: npm run build
- name: Remove dev values from package.json and package-lock.json
run: |
npm pkg delete commitlint devDependencies jest scripts
npm pkg set scripts.start="node ."
npm i --ignore-scripts
- name: Create release asset
run: >
zip -r ${{ github.event.repository.name }}-${{ needs.release.outputs.tag_name }}.zip
.dockerignore .env.template .pm2.config.js
docker-compose.yml Dockerfile LICENSE
package.json package-lock.json README.md
dist ocr_lang_data .npmrc
- name: Upload release asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.release.outputs.upload_url }}
asset_path: ./${{ github.event.repository.name }}-${{ needs.release.outputs.tag_name }}.zip
asset_name: ${{ github.event.repository.name }}-${{ needs.release.outputs.tag_name }}.zip
asset_content_type: application/zip