-
Notifications
You must be signed in to change notification settings - Fork 9
106 lines (88 loc) · 3.17 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
name: Create a new release
on:
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '20'
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.9'
- name: Create .env file
run: |
cp .env.example .env
sed -i 's/^DICT_NAME=.*/DICT_NAME=kty/' .env
- name: Install jq
run: sudo apt-get install -y jq
- name: Install gzip
run: sudo apt-get install -y gzip
- name: Install npm dependencies
run: npm install
- name: Run auto.sh script
run: ./auto.sh Albanian German
- name: Run merge-ipa
run: node merge-ipa.js
- name: Generate list of .zip files
id: generate_file_list
run: |
find data/language -type f -name '*.zip' > zip_files.txt
cat zip_files.txt
echo "zip_files<<EOF" >> $GITHUB_OUTPUT
cat zip_files.txt >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
- name: Configure git
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
- name: Tag the repository
id: tag
run: |
# See https://docs.github.com/en/get-started/using-git/dealing-with-special-characters-in-branch-and-tag-names
TAG=v$(date -Iseconds | sed 's/[T:\+]/-/g')
CALVER=$(date +'%y.%m.%d.%H')
echo "$TAG"
echo "tag=$TAG" >> $GITHUB_OUTPUT
echo "calver=$CALVER" >> $GITHUB_OUTPUT
git tag -a $TAG -m "Published version $TAG" ${GITHUB_SHA}
git push origin $TAG
- name: Generate markdown table
id: generate_markdown
run: |
./tools/generate-downloads-table.sh > table.md
cat table.md
- name: Write to downloads.md
id: write_downloads_md
shell: bash
run: |
branch="update-downloads-md-$(date +%s)"
git checkout -b "$branch"
cat downloads-preamble.md table.md > downloads.md
git add downloads.md
git commit -m "Update downloads.md with list of .zip files"
git push -u origin "$branch"
echo "branch=$branch" >> $GITHUB_OUTPUT
rm table.md
cat downloads.md
- name: Create pull request
uses: peter-evans/create-pull-request@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ steps.write_downloads_md.outputs.branch }}
base: master
title: "Update downloads.md with list of .zip files"
body: "This PR updates the downloads.md file with a table listing all .zip files."
- name: Release
uses: softprops/action-gh-release@v2
with:
name: ${{ steps.tag.outputs.calver }}
tag_name: ${{ steps.tag.outputs.tag }}
prerelease: true
generate_release_notes: true
files: ${{ steps.generate_file_list.outputs.zip_files }}