-
Notifications
You must be signed in to change notification settings - Fork 11
119 lines (103 loc) · 3.65 KB
/
release.yml
File metadata and controls
119 lines (103 loc) · 3.65 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
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
111
112
113
114
115
116
117
118
119
name: Zork++ Release
on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'
- 'v[0-9]+.[0-9]+.[0-9]+rc[0-9]+'
jobs:
generate-release:
permissions:
contents: write
runs-on: 'ubuntu-latest'
steps:
- name: Generate release ${{ steps.version.outputs.version }}
uses: actions/create-release@v1
id: create-release
with:
draft: false
prerelease: false
release_name: ${{ steps.version.outputs.version }}
tag_name: ${{ github.ref }}
env:
GITHUB_TOKEN: ${{ github.token }}
outputs:
upload_url: ${{ steps.create-release.outputs.upload_url }}
generate-binaries:
needs: 'generate-release'
permissions:
contents: write
strategy:
matrix:
os: ['ubuntu-latest', 'windows-latest']
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
with:
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.event.pull_request.head.ref }}
- name: Caching cargo dependencies
id: project-cache
uses: Swatinem/rust-cache@v2
- name: Make Rust environment
uses: actions-rs/toolchain@v1
with:
toolchain: stable
- name: Building Zork's exe
working-directory: ./zork++
run: |
cargo build --release
- name: Install cargo-deb
run: |
cargo install cargo-deb
- name: Generate .deb package for Linux
if: ${{ matrix.os == 'ubuntu-latest' }}
working-directory: ./zork++
run: |
cargo deb --no-build --output ./target/debian/zork.deb
mv ./target/debian/zork.deb ./target/debian/zork++.deb
- name: Building the installer with Inno Setup
if: ${{ matrix.os == 'windows-latest' }}
run: |
rename ".\zork++\target\release\zork.exe" "zork++.exe"
"%programfiles(x86)%\Inno Setup 6\iscc.exe" ".\release-config\windows-installer-zork.iss"
shell: cmd
- name: Make Zip for Windows
if: ${{ matrix.os == 'windows-latest' }}
run: |
7z a windows-installer.zip zork-installer.exe
- name: Generate compressed tar archive for Linux
if: ${{ matrix.os == 'ubuntu-latest' }}
working-directory: ./zork++
run: |
mv ./target/release/zork ./target/release/zork++
tar -czvf zork++.tar.gz ./target/release/zork++ ../LICENSE
- name: Upload Windows artifact
if: ${{ matrix.os == 'windows-latest' }}
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ needs.generate-release.outputs.upload_url }}
asset_path: windows-installer.zip
asset_name: windows-installer.zip
asset_content_type: application/zip
- name: Upload Linux tar archive
if: ${{ matrix.os == 'ubuntu-latest' }}
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ needs.generate-release.outputs.upload_url }}
asset_path: ./zork++/zork++.tar.gz
asset_name: ./zork++/zork++.tar.gz
asset_content_type: application/tar+gzip
- name: Upload Linux .deb package
if: ${{ matrix.os == 'ubuntu-latest' }}
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ needs.generate-release.outputs.upload_url }}
asset_path: zork++/target/debian/zork++.deb
asset_name: zork++.deb
asset_content_type: application/vnd.debian.binary-package