-
Notifications
You must be signed in to change notification settings - Fork 3
113 lines (90 loc) · 3.13 KB
/
release.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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
name: Release Locale
on:
push:
tags:
- v*
jobs:
package:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '18.x'
registry-url: 'https://registry.npmjs.org'
- name: Extract tag
run: |
echo "TAG=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- name: Extract version
run: |
VERSION=$(echo $TAG | sed 's/^v\([0-9]*\.[0-9]*\.[0-9]*\)-.*$/\1/')
echo "VERSION=${VERSION}" >> $GITHUB_ENV
- name: Extract language code
run: |
LANG=$(echo $TAG | sed 's/^v[0-9]*\.[0-9]*\.[0-9]*-\(.*\)$/\1/')
echo "LANG=${LANG}" >> $GITHUB_ENV
- name: Check locale to release
run: |
ls -lah locales/$LANG
- name: Install DSW Locale Packager
run: |
npm install @ds-wizard/[email protected]
- name: Create locale ZIP package
run: |
npx dsw-locale-packager locales/$LANG -o dsw_${{ env.LANG }}_${{ env.VERSION }}.zip -z
- name: Create release and upload ZIP
uses: ncipollo/release-action@v1
id: create_release
with:
allowUpdates: true
artifactErrorsFailBuild: true
artifacts: "dsw_${{ env.LANG }}_${{ env.VERSION }}.zip"
artifactContentType: application/zip
prerelease: ${{ steps.check_prerelease.outputs.is_prerelease }}
replacesArtifacts: true
push:
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '18.x'
registry-url: 'https://registry.npmjs.org'
- name: Set up Python
uses: actions/setup-python@v5
with:
node-version: '3.12'
- name: Extract tag
run: |
echo "TAG=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- name: Extract version
run: |
VERSION=$(echo $TAG | sed 's/^v\([0-9]*\.[0-9]*\.[0-9]*\)-.*$/\1/')
echo "VERSION=${VERSION}" >> $GITHUB_ENV
- name: Extract language code
run: |
LANG=$(echo $TAG | sed 's/^v[0-9]*\.[0-9]*\.[0-9]*-\(.*\)$/\1/')
echo "LANG=${LANG}" >> $GITHUB_ENV
- name: Check locale to release
run: |
ls -lah locales/$LANG
- name: Install dependencies
run: |
npm install @ds-wizard/[email protected]
pip install -r scripts/requirements.txt
- name: Create locale ZIP package
run: |
npx dsw-locale-packager locales/$LANG -o dsw_${{ env.LANG }}_${{ env.VERSION }}.zip -z
- name: Push to DSW
run: |
python scripts/dsw-locales.py clear -y -o dsw -l ${{ env.LANG }}
python scripts/dsw-locales.py push dsw_${{ env.LANG }}_${{ env.VERSION }}.zip -e
env:
DSW_API_URL: ${{ secrets.INTERNAL_DSW_API_URL }}
DSW_API_KEY: ${{ secrets.INTERNAL_DSW_API_KEY }}