forked from bmos/FG-CoreRPG-Coins-Weight
-
Notifications
You must be signed in to change notification settings - Fork 0
120 lines (103 loc) · 3.75 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
114
115
116
117
118
119
120
on:
push:
# Sequence of patterns matched against refs/tags
tags:
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
name: Release Build
permissions: write-all
env:
EXTENSION: ${{ vars.FORGE_EXTENSION }}
IS_PRERELEASE: ${{ contains(github.ref_name,'-rc') }} && ${{ contains(github.ref_name,'-test') }}
jobs:
build:
name: Create Release
runs-on: ubuntu-latest
steps:
- name: Checkout Repo Assets
uses: actions/checkout@v4
- name: Zip Assets Into ${{ env.EXTENSION }} File
uses: thedoctor0/zip-release@0.7.6
with:
filename: ${{ github.event.repository.name }}${{ env.EXTENSION }}
exclusions: '*.git* /*node_modules/* .editorconfig body.md *.psd *.xcf forge-thumbnail.png thumbnail.png *.toml'
- name: Add ${{ env.EXTENSION }} File to Release
uses: ncipollo/release-action@v1
with:
artifacts: ${{ github.event.repository.name }}${{ env.EXTENSION }}
prerelease: ${{ env.IS_PRERELEASE != 'false && false' }}
allowUpdates: true
generateReleaseNotes: true
- uses: actions/upload-artifact@v4
with:
name: ${{ github.event.repository.name }}${{ env.EXTENSION }}
path: ${{ github.event.repository.name }}${{ env.EXTENSION }}
upload:
name: Upload to Forge
runs-on: ubuntu-latest
needs: build
if: ${{ vars.FORGE_ITEM_ID != '' }}
steps:
- name: Checkout FG-Forge-Updater repository
uses: actions/checkout@v4
with:
repository: 'bmos/FG-Forge-Updater'
ref: 'v1.1'
- name: Set up python 3.12
uses: actions/setup-python@v5
with:
python-version: "3.12"
cache: 'pip'
- name: Install uv and create venv
run: |
pip install -U pip uv
uv venv
- name: Enable macOS/Linux venv
if: runner.os != 'Windows'
run: |
source .venv/bin/activate
echo $PATH >> $GITHUB_PATH
- name: Enable Windows venv
if: runner.os == 'Windows'
run: |
.venv\Scripts\activate
echo $env:path >> $ENV:GITHUB_PATH
- name: Install dependencies
run: |
uv pip install -e .
- uses: actions/download-artifact@v4
with:
name: ${{ github.event.repository.name }}${{ env.EXTENSION }}
- name: Upload ${{ env.EXTENSION }} file to live channel
id: upload-live
if: ${{ env.IS_PRERELEASE == 'false && false' }}
env:
FG_RELEASE_CHANNEL: Live
FG_ITEM_ID: ${{ vars.FORGE_ITEM_ID }}
FG_USER_NAME: ${{ vars.FORGE_USER_NAME }}
FG_USER_PASS: ${{ secrets.FORGE_USER_PASS }}
FG_UL_FILE: ${{ github.event.repository.name }}${{ env.EXTENSION }}
FG_README_UPDATE: "TRUE"
FG_UPLOAD_BUILD: "TRUE"
FG_GRAPH_SALES: "TRUE"
run: |
python -m src.main
- name: Upload ${{ env.EXTENSION }} file to test channel
id: upload-test
if: ${{ env.IS_PRERELEASE != 'false && false' }}
env:
FG_RELEASE_CHANNEL: Test
FG_ITEM_ID: ${{ vars.FORGE_ITEM_ID }}
FG_USER_NAME: ${{ vars.FORGE_USER_NAME }}
FG_USER_PASS: ${{ secrets.FORGE_USER_PASS }}
FG_UL_FILE: ${{ github.event.repository.name }}${{ env.EXTENSION }}
FG_README_UPDATE: "FALSE"
FG_UPLOAD_BUILD: "TRUE"
FG_GRAPH_SALES: "TRUE"
run: |
python -m src.main
- name: Add cumulative users graph to release
uses: ncipollo/release-action@v1
with:
body: "![Cumulative Users Graph](https://github.com/${{ github.repository }}/releases/download/${{ github.ref_name }}/cumulative_users.png)"
artifacts: cumulative_users.png
allowUpdates: true