-
Notifications
You must be signed in to change notification settings - Fork 1
89 lines (85 loc) · 3.26 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
# This is a basic workflow that is manually triggered
name: Release
# Controls when the action will run. Workflow runs when manually triggered using the UI
# or API.
on:
workflow_dispatch:
# Inputs the workflow accepts.
inputs:
version-number:
# Friendly description to be shown in the UI instead of 'name'
description: 'Which version to label this release as'
# Default value if no value is explicitly provided
default: '0.0.0'
# Input has to be provided for the workflow to run
required: true
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository and submodules
uses: actions/checkout@v4.1.5
with:
submodules: recursive
fetch-depth: 0
- name: Let the program now it's version
run: echo ${{ github.event.inputs.version-number }} > version.txt
- name: Remove development HTTPS library
run: rm https.dll
- name: "Build binaries"
id: "love-build"
uses: nhartland/love-build@v1-beta4
with:
# Name of the application to be built
app_name: "Chaoshead"
# Version of LÖVE to be used in building the application
love_version: 11.4
# Path in the repository to the subdirectory containing `main.lua`. By default the repo root
# source_dir: # default is ./
# Directory in the GitHub workspace where the built distributables should be located
result_dir: "binaries"
# 32 bits
- run: mkdir "extract"
- name: Unzip binary release for modification
uses: DuckSoft/extract-7z-action@v1.0
with:
pathSource: ${{ steps.love-build.outputs.win32-filename }}
pathTarget: "extract"
- run: mv "extract/Chaoshead_win32/" "release/"
# The artifact expired :(
# - name: Add release HTTPS library
# uses: dawidd6/action-download-artifact@v2.25.0
# with:
# repo: love2d/lua-https
# workflow: build.yml
# workflow_conclusion: success
# name: https-windows-Win32.zip
# path: release
- run: cp "https32.dll" "release/https.dll"
# licenses and credits
- run: cp "credits.txt" "release/credits.txt"
- run: mv "release/license.txt" "release/license-love2d.txt"
- run: cp "LICENSE.txt" "release/license-Chaoshead.txt"
- run: mv "licenses/" "release/licenses/"
- uses: actions/upload-artifact@v4.3.3
with:
name: win32-build
path: release
- name: Package binaries for Github release
uses: vimtor/action-zip@v1
with:
files: release/
dest: chaoshead-win32.zip
- name: Collect commits since last release to make making the changelog easier
run: git log $(git describe --tags --abbrev=0)..HEAD --format=format:"> %s%+b" > commits.txt
- name: Create release
id: create-release
uses: softprops/action-gh-release@v2.0.4
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
body_path: commits.txt
files: chaoshead-win32.zip
tag_name: "v${{ github.event.inputs.version-number }}"
name: "Chaoshead v${{ github.event.inputs.version-number }}"
draft: true