-
Notifications
You must be signed in to change notification settings - Fork 0
71 lines (61 loc) · 2.34 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
name: Release
on:
push:
tags:
# This will only run the release workflow when it's tagged with a version
# tag.
- "v*"
jobs:
build:
uses: ./.github/workflows/build.yml
with:
artifact-suffix: Release
package:
name: Release
needs: build
runs-on: ubuntu-latest
steps:
- name: Set Environment Variables
run: |
echo "MOD_PATH=$HOME/RealisticOrbitalTrade" >> $GITHUB_ENV
echo "VERSION=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV
echo "NO_PREFIX_VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENV
- name: Create Mod Folder
run: mkdir -p ${{ env.MOD_PATH }}
- name: Download Mod Artifacts from Build Step
uses: actions/download-artifact@v4
with:
name: RealisticOrbitalTrade-Release
path: ${{ env.MOD_PATH }}
- name: Zip Mod
run: |
cd $HOME
zip -r ./RealisticOrbitalTrade.zip ./RealisticOrbitalTrade/*
- name: Checkout Repository
uses: actions/checkout@v4
- name: Get Changelog Entry
id: changelog_reader
uses: mindsers/changelog-reader-action@v2
with:
version: ${{ env.NO_PREFIX_VERSION }}
path: ./CHANGELOG.md
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ env.VERSION }}
release_name: Release ${{ env.VERSION }}
body: ${{ steps.changelog_reader.outputs.changes }}
draft: false
prerelease: false
- name: 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: ${{ env.MOD_PATH }}.zip
asset_name: RealisticOrbitalTrade-${{ env.VERSION }}.zip
asset_content_type: application/zip