forked from SinTh0r4s/ExampleMod1.7.10
-
Notifications
You must be signed in to change notification settings - Fork 77
86 lines (77 loc) · 2.84 KB
/
release-packages.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
# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle
name: Release latest starter and migration packages
on:
push:
branches: [ master, main ]
tags: [ '*' ]
jobs:
zip-and-release-packages:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set release version
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- name: Prepare release folder
run: |
mkdir packages
- name: Zip starter
uses: montudor/action-zip@v1
with:
args: >
zip -r packages/starter.zip . \
\
-x "*.git/*" \
\
-x ".github/scripts/update_version" \
-x ".github/workflows/buildscript-maintenance.yml" \
-x ".github/workflows/release-packages.yml" \
\
-x "*docs/*" \
-x "README.md" \
-x "LICENSE" \
-x "gtnhShared/*" \
\
-x "packages/" \
-x "packages/starter.zip" \
-x "packages/migration.zip"
- name: Zip migration
uses: montudor/action-zip@v1
with:
args: >
zip -r packages/migration.zip . \
\
-x "*.git/*" \
\
-x ".github/scripts/update_version" \
-x ".github/workflows/buildscript-maintenance.yml" \
-x ".github/workflows/release-packages.yml" \
\
-x "*docs/*" \
-x "*src/*" \
-x "LICENSE" \
-x "README.md" \
-x "gtnhShared/*" \
\
-x "packages/" \
-x "packages/starter.zip" \
-x "packages/migration.zip"
- name: Update latest tag
uses: "marvinpinto/action-automatic-releases@latest"
if: ${{ (github.ref == 'master' || github.ref == 'main') }}
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "latest-packages"
prerelease: true
title: "Latest starter and migration packages"
files: packages/*
- name: Release named version
if: ${{ !(github.ref == 'master' || github.ref == 'main') }}
uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "${{ env.RELEASE_VERSION }}-packages"
prerelease: false
title: "${{ env.RELEASE_VERSION }} starter and migration packages"
files: packages/*