forked from ParadoxGameConverters/ImperatorToCK3
-
Notifications
You must be signed in to change notification settings - Fork 0
110 lines (109 loc) · 3.39 KB
/
create_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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
name: Create release
on:
push:
tags:
- '*'
jobs:
create_release:
runs-on: ubuntu-latest
outputs:
upload_url: ${{ steps.create_release.outputs.upload_url }}
tag: ${{ steps.previoustag.outputs.tag }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: "Get previous tag"
id: previoustag
uses: "WyriHaximus/github-action-get-previous-tag@v1"
- name: "Build changelog"
id: build_changelog
uses: mikepenz/release-changelog-builder-action@v3
with:
configuration: ".github/config/changelog-config.json"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: "Create release"
id: create_release
uses: ncipollo/release-action@v1
with:
tag: ${{ steps.previoustag.outputs.tag }}
body: ${{ steps.build_changelog.outputs.changelog }}
token: ${{ secrets.API_TOKEN_GITHUB }}
add_release_archive:
needs: create_release
runs-on: ${{ matrix.os }}
strategy:
matrix:
build:
- win-x64
- linux-x64
- osx-x64
include:
- build: win-x64
os: windows-2022
archive_type: zip
archive_extension: .zip
asset_content_type: application/zip
- build: linux-x64
os: ubuntu-latest
archive_type: tar
archive_extension: .tgz
asset_content_type: application/gzip
- build: osx-x64
os: macos-latest
archive_type: tar
archive_extension: .tgz
asset_content_type: application/gzip
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
submodules: recursive
- name: Setup Dotnet for use with actions
uses: actions/setup-dotnet@v2
with:
dotnet-version: '6.*'
- name: "Add version to version.txt"
shell: bash
run: |
cd ImperatorToCK3/Data_Files/configurables
printf "\nversion = ${{ needs.create_release.outputs.tag }}" >> version.txt
- name: "Build frontend"
uses: ./Fronter.NET/.github/actions/build_frontend
with:
fronter_dir: 'Fronter.NET'
release_dir: 'Release'
- name: "Build backend"
run: |
cd ImperatorToCK3
dotnet publish -p:PublishProfile=${{ matrix.build }} -c:Release
- name: "Remove Release/ImperatorToCK3 directory"
uses: JesseTG/[email protected]
with:
path: Release/ImperatorToCK3
- name: "Copy Publish files to Release directory"
shell: bash
run: |
cp -R Publish/* Release/
- name: "Save commit ID"
shell: bash
run: |
git rev-parse HEAD > Release/commit_id.txt
- name: Archive Release folder
uses: thedoctor0/zip-release@master
with:
type: '${{ matrix.archive_type }}'
directory: 'Release'
path: '.'
filename: '../ImperatorToCK3-${{ matrix.build }}${{ matrix.archive_extension }}'
- name: Upload release asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create_release.outputs.upload_url }}
asset_path: './ImperatorToCK3-${{ matrix.build }}${{ matrix.archive_extension }}'
asset_name: 'ImperatorToCK3-${{ matrix.build }}${{ matrix.archive_extension }}'
asset_content_type: ${{ matrix.asset_content_type }}