-
Notifications
You must be signed in to change notification settings - Fork 2
121 lines (97 loc) · 3.96 KB
/
release.yaml
File metadata and controls
121 lines (97 loc) · 3.96 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
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
114
115
116
117
118
119
120
121
name: Release
on:
push:
tags:
- v*
env:
FORCE_COLOR: true
jobs:
build:
name: Build Release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Download ultimate-crosscode-typedefs
uses: actions/checkout@v2
with:
repository: dmitmel/ultimate-crosscode-typedefs
path: ultimate-crosscode-typedefs
- uses: actions/setup-node@v1
with:
node-version: '16.x'
- name: Get Yarn cache directory
id: yarn_cache_dir
run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: actions/cache@v2
with:
path: |
${{ steps.yarn_cache_dir.outputs.dir }}
key: |
r1/${{ github.workflow }}/${{ runner.os }}/yarn/${{ hashFiles('**/yarn.lock') }}
restore-keys: |
r1/${{ github.workflow }}/${{ runner.os }}/yarn/
- name: Set up ultimate-crosscode-typedefs
working-directory: ultimate-crosscode-typedefs
run: |
yarn install --frozen-lockfile --production
yarn link
- name: Install dependencies
run: |
yarn link ultimate-crosscode-typedefs
yarn install --frozen-lockfile
- name: Build
run: yarn run build
- name: Download the latest translations from Notabenoid
env:
NOTABENOID_CREDENTIALS: ${{ secrets.NOTABENOID_CREDENTIALS }}
if: env.NOTABENOID_CREDENTIALS != ''
run: |
nota_username="${NOTABENOID_CREDENTIALS%%:*}"
nota_password="${NOTABENOID_CREDENTIALS#*:}"
node tool/dist/headless-main.js --username @"$nota_username" --password @"$nota_password" --output assets/ru-translation-tool --fetchConnections 8 --progress
- name: Export Localize Me translation packs
run: node tool/dist/headless-export.js assets/ru-translation-tool/
- name: Make translations
working-directory: dist-archive
run: make -j$(nproc) compile-translations
- name: Make everything else
working-directory: dist-archive
run: make
- name: Preparing metadata of the release
id: release_meta
run: |
date="$(date '+%Y-%m-%d')"
tag="${GITHUB_REF#refs/tags/}"
title="${tag}, LTS ${date}"
body_path="$(mktemp -t release_body.XXXXXXXXXX.md)"
cat > "$body_path" <<EOF
Смотрите [инструкцию по установке](https://github.com/CCDirectLink/crosscode-ru#краткая-инструкция-по-установке) на главной странице.
**Совместимые версии игры:** 1.4.2-2
[](https://github.com/CCDirectLink/crosscode-ru/releases/download/${tag}/crosscode-ru_quick-install_${tag}.zip)
## Нововведения
## Изменения
## Исправления
EOF
gha_set_output() {
local name="$1" str="$2"
str="${str//'%'/'%25'}"; str="${str//$'\n'/'%0A'}"; str="${str//$'\r'/'%0D'}"
printf "::set-output name=%s::%s\n" "$name" "$str"
}
gha_set_output title "${title}"
gha_set_output body_path "$body_path"
- name: Create the release
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
name: ${{ steps.release_meta.outputs.title }}
body_path: ${{ steps.release_meta.outputs.body_path }}
draft: true
prerelease: false
files: |
dist-archive/crosscode-ru_quick-install_v*.tgz
dist-archive/crosscode-ru_quick-install_v*.zip
dist-archive/crosscode-ru_v*.tgz
dist-archive/crosscode-ru_v*.zip
dist-archive/ultimate-localized-ui_v*.tgz
dist-archive/ultimate-localized-ui_v*.zip