forked from emyhrberg/ModReloader
-
Notifications
You must be signed in to change notification settings - Fork 0
70 lines (62 loc) · 2.36 KB
/
release.yml
File metadata and controls
70 lines (62 loc) · 2.36 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
# name: Release ModReloader
# on:
# workflow_run:
# workflows: ["Build Mod"] # ⚙️ name in build‑mod.yml
# types: [completed]
# permissions:
# contents: write # needed for tags & releases
# jobs:
# release:
# if: >
# ${{
# github.event.workflow_run.conclusion == 'success' &&
# github.event.workflow_run.head_branch == 'master'
# }}
# runs-on: windows-latest
# defaults:
# run:
# shell: pwsh
# steps:
# # 1️⃣ Get the exact commit that Build Mod just built
# - name: Checkout built commit
# uses: actions/checkout@v4
# with:
# ref: ${{ github.event.workflow_run.head_sha }}
# fetch-depth: 0 # we’ll tag this commit
# # 2️⃣ Pull the build artifact from that run
# - name: Download ModReloader-Binaries artifact
# uses: dawidd6/action-download-artifact@v3
# with:
# run_id: ${{ github.event.workflow_run.id }}
# name: ModReloader-Binaries
# path: artifact
# # 3️⃣ Locate the .tmod file inside the artifact
# - name: Locate .tmod file
# id: asset
# run: |
# $asset = Get-ChildItem -Path artifact -Filter *.tmod -Recurse |
# Select-Object -First 1
# if (-not $asset) {
# Write-Error "No .tmod file inside artifact!"
# exit 1
# }
# "file=$($asset.FullName)" | Out-File $env:GITHUB_OUTPUT -Append
# Write-Host "Asset: $($asset.FullName)"
# # 4️⃣ Extract version from build.txt in this commit
# - name: Extract version
# id: get_version
# run: |
# $verLine = Select-String build.txt -Pattern '^version\s*=' |
# Select-Object -First 1
# $version = ($verLine.Line -split '=')[1].Trim()
# "version=$version" | Out-File $env:GITHUB_OUTPUT -Append
# Write-Host "Detected version $version"
# # 5️⃣ Create / reuse the tag and GitHub release
# - name: Publish GitHub release
# uses: ncipollo/release-action@v1
# with:
# tag: "v${{ steps.get_version.outputs.version }}"
# name: "v${{ steps.get_version.outputs.version }}"
# artifacts: "${{ steps.asset.outputs.file }}"
# generateReleaseNotes: true
# skipIfReleaseExists: true