-
Notifications
You must be signed in to change notification settings - Fork 0
97 lines (82 loc) · 2.73 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
name: Update Translations and Create PAYDAY Mod Release
on:
push:
paths:
- 'Crowdin/translated/**'
- 'converter.py'
jobs:
update_translations:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pandas
- name: Run translation script
run: python converter.py
- name: Commit and push changes
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git config --local user.name "GitHub Actions"
git config --local user.email "actions@github.com"
git add .
git commit -m "Automated Lua file update" || echo "No changes to commit"
git push "https://${GITHUB_TOKEN}@github.com/Parapando/Payday-2-UA.git" HEAD:crowdin_sync
create_release:
runs-on: windows-latest
needs: update_translations
steps:
- uses: actions/checkout@v2
with:
ref: crowdin_sync
- name: Delete Existing Release
uses: ame-yu/action-delete-latest-release@v2
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Archive Mod
run: |
.\.github\7za.exe -tzip a ".\pd2_ualoc.zip" ".\Ukrainian Localization"
shell: powershell
- name: Create New Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: pd2_ualoc
release_name: Release pd2_ualoc
draft: false
prerelease: false
body: |
This release zip is automatically updated on every push. You can ignore the "x commits behind" message.
- name: Upload Mod Zip to Release
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./pd2_ualoc.zip
asset_name: pd2_ualoc.zip
asset_content_type: application/zip
- name: Hash mod and create mod meta file
id: create_meta_file
run: |
$(cat .\.github\meta.json).Replace("%HASH%", $(./.github/hash.exe "./Ukrainian Localization").Substring(17)) > ./meta.json
- name: Upload meta file to Release
id: upload-meta-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./meta.json
asset_name: meta.json
asset_content_type: application/json