-
Notifications
You must be signed in to change notification settings - Fork 0
61 lines (51 loc) · 2.04 KB
/
main.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
name: Create Release
on:
push:
branches: [ main ]
jobs:
build:
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Get Buld Version
run: echo "BUILD_VERSION=$(jq -r '.version' module.json)" >> $GITHUB_ENV
- name: Get Release Tag
run: echo "RELEASE_VERSION=$(jq -r '.compatibility.verified' module.json)" >> $GITHUB_ENV
- name: Update Download Link
run: |
jq '.download = "https://github.com/GMonlineua/foundryvtt-ua/releases/download/v${{ env.RELEASE_VERSION }}/foundry.zip"' module.json > tmp.json && mv tmp.json module.json
- name: Update Readme
run: |
PACKAGE="https://img.shields.io/badge/Version-${{ env.BUILD_VERSION }}-informational?style=flat-square"
PACKAGE_LINK="https://github.com/GMonlineua/foundryvtt-ua/releases/tag/v${{ env.RELEASE_VERSION }}"
FOUNDRY="https://img.shields.io/badge/Foundry-${{ env.RELEASE_VERSION }}-orange?style=flat-square"
sed -i "s|\[Version\]:.*|\[Version\]: $PACKAGE|" README.md
sed -i "s|\[Foundry\]:.*|\[Foundry\]: $FOUNDRY|" README.md
- name: Commit AutoBuild
run: |
git config --global user.email "[email protected]"
git config --global user.name "GitHub Actions"
git add README.md module.json
if git diff-index --quiet HEAD; then
echo "No changes to commit"
else
git commit -m "Auto update files ${{ env.RELEASE_VERSION }}"
git push
fi
- name: Create Zip Archive
run: |
zip -r foundry.zip module.json lang/uk.json
- name: Create Release
id: create_release
uses: softprops/action-gh-release@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v${{ env.RELEASE_VERSION }}
name: Release ${{ env.RELEASE_VERSION }}
draft: false
prerelease: false
files: ./foundry.zip