-
Notifications
You must be signed in to change notification settings - Fork 5
75 lines (64 loc) · 2.23 KB
/
release.yml
File metadata and controls
75 lines (64 loc) · 2.23 KB
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
name: Package and Publish
on:
push:
tags:
- 'v*'
env:
TAG_NAME: ${{ github.ref_name }}
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Download Everest stripped lib
uses: coloursofnoise/get-azure-pipelines-artifact@v0.0.3
with:
repository: EverestAPI/Everest
definitionId: 3
artifact: lib-stripped
reasonFilter: 'individualCI'
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: 5.0.x
- name: Restore with .NET Core
run: dotnet restore
- name: Run Pre-Build Script
run: |
export MOD_VERSION=${TAG_NAME#v}
[[ "$MOD_VERSION" =~ -.*$ ]] && PRERELEASE=true || PRERELEASE=false
echo "MOD_VERSION=$MOD_VERSION" >> $GITHUB_ENV
echo "PRERELEASE=$PRERELEASE" >> $GITHUB_ENV
yq e -i '.[0].Version = strenv(MOD_VERSION)' everest.yaml
- name: Build with .NET Core
run: dotnet build "/p:Configuration=Debug"
env:
CELESTEGAMEPATH: ${{ github.workspace }}/lib-stripped
- name: Upload artifact
uses: actions/upload-artifact@v1.0.0
with:
name: main
path: FancyTileEntities/bin/Debug/net452
- name: Create mod zip
run: zip -qq -r FancyTileEntities.zip Ahorn Loenn FancyTileEntities/bin everest.yaml
- name: Create Release
id: release
uses: softprops/action-gh-release@58fa4b7a8863f6beaf115a49196308842b8b0f06
with:
name: FancyTileEntities ${{ env.MOD_VERSION }}
files: FancyTileEntities.zip
fail_on_unmatched_files: true
prerelease: ${{ env.PRERELEASE }}
- name: Update release description
env:
RELEASE_ID: ${{ steps.release.outputs.id }}
DOWNLOAD_URL: ${{ fromJSON(steps.release.outputs.assets)[0].browser_download_url }}
run: |
curl \
-X PATCH \
-H "Accept: application/vnd.github.v3+json" \
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
"https://api.github.com/repos/$GITHUB_REPOSITORY/releases/$RELEASE_ID" \
-d "$(jq -n \
--arg url $DOWNLOAD_URL \
'{body: "[Install FancyTileEntities.zip](https://0x0a.de/twoclick/?\($url))"}')"