-
Notifications
You must be signed in to change notification settings - Fork 18
Create deb and rpm automatically #25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||
---|---|---|---|---|---|---|---|---|
@@ -1,5 +1,7 @@ | ||||||||
name: CI | ||||||||
on: [push, pull_request] | ||||||||
env: | ||||||||
dotnet-version: '7.0' | ||||||||
jobs: | ||||||||
build: | ||||||||
name: Build OpenLauncher | ||||||||
|
@@ -17,9 +19,9 @@ jobs: | |||||||
- name: Checkout | ||||||||
uses: actions/checkout@v3 | ||||||||
- name: Setup .NET Core SDK | ||||||||
uses: actions/setup-dotnet@v1 | ||||||||
uses: actions/setup-dotnet@v3 | ||||||||
with: | ||||||||
dotnet-version: '7.0.x' | ||||||||
dotnet-version: ${{ env.dotnet-version }} | ||||||||
- name: Restore | ||||||||
run: dotnet restore | ||||||||
- name: Build | ||||||||
|
@@ -30,14 +32,80 @@ jobs: | |||||||
working-directory: src/openlauncher | ||||||||
run: dotnet publish -c Release -r ${{ matrix.rid }} --self-contained | ||||||||
- name: Upload artifacts | ||||||||
uses: actions/upload-artifact@v2 | ||||||||
uses: actions/upload-artifact@v4 | ||||||||
with: | ||||||||
name: "OpenLauncher-${{ matrix.rid }}" | ||||||||
path: src/openlauncher/bin/Release/net7.0/${{ matrix.rid }}/publish/**/* | ||||||||
- name: Create release | ||||||||
uses: softprops/action-gh-release@v1 | ||||||||
path: src/openlauncher/bin/Release/net${{ env.dotnet-version }}/${{ matrix.rid }}/publish/**/* | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||
|
||||||||
package: | ||||||||
name: deb and rpm packaging | ||||||||
runs-on: ubuntu-latest | ||||||||
needs: [build] | ||||||||
if: startsWith(github.ref, 'refs/tags/v') | ||||||||
with: | ||||||||
files: | | ||||||||
src/openlauncher/bin/Release/net7.0/${{ matrix.rid }}/publish/openlauncher | ||||||||
src/openlauncher/bin/Release/net7.0/${{ matrix.rid }}/publish/openlauncher.exe | ||||||||
steps: | ||||||||
- name: Checkout | ||||||||
uses: actions/checkout@v3 | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||
- name: Setup .NET Core SDK | ||||||||
uses: actions/setup-dotnet@v3 | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||
with: | ||||||||
dotnet-version: ${{ env.dotnet-version }} | ||||||||
- name: Restore | ||||||||
run: dotnet restore | ||||||||
- name: Publish | ||||||||
working-directory: src/openlauncher | ||||||||
run: dotnet publish -c Release -r linux-x64 -p:PublishSingleFile=true -p:SelfContained=false -p UseAppHost=true -p:EnableCompressionInSingleFile=false # Build to use OS runtime, has to be architecture dependent per documentation :( | ||||||||
- name: Prepare to create deb and rpm files | ||||||||
run: | | ||||||||
mkdir -p .pkg/usr/bin | ||||||||
mkdir -p .pkg/usr/share/applications | ||||||||
mkdir -p .pkg/usr/share/icons | ||||||||
cp src/openlauncher/resources/logo.svg .pkg/usr/share/icons/openlauncher.svg | ||||||||
cp src/openlauncher/resources/OpenLauncher.desktop .pkg/usr/share/applications/OpenLauncher.desktop | ||||||||
cp src/openlauncher/bin/Release/net${{ env.dotnet-version }}/linux-x64/publish/openlauncher .pkg/usr/bin/openlauncher | ||||||||
chmod +x .pkg/usr/bin/openlauncher | ||||||||
- name: Create rpm | ||||||||
uses: jiro4989/build-rpm-action@v2 | ||||||||
with: | ||||||||
package: openlauncher | ||||||||
summary: 'A launcher for automatically downloading the latest, or specific versions of OpenRCT2 and OpenLoco.' | ||||||||
package_root: .pkg | ||||||||
maintainer: Ted John | ||||||||
version: ${{github.ref_name}} # refs/tags/v*.*.* | ||||||||
arch: 'x86_64' | ||||||||
license: 'MIT' | ||||||||
requires: dotnet-runtime-${{ env.dotnet-version }} | ||||||||
- name: Create deb | ||||||||
uses: jiro4989/build-deb-action@v3 | ||||||||
with: | ||||||||
package: openlauncher | ||||||||
package_root: .pkg | ||||||||
maintainer: Ted John | ||||||||
version: ${{github.ref_name}} # refs/tags/v*.*.* | ||||||||
arch: 'amd64' | ||||||||
desc: 'A launcher for automatically downloading the latest, or specific versions of OpenRCT2 and OpenLoco.' | ||||||||
depends: dotnet-runtime-${{ env.dotnet-version }} | ||||||||
- uses: actions/upload-artifact@v4 | ||||||||
with: | ||||||||
name: artifact-deb-rpm | ||||||||
path: | | ||||||||
./*.deb | ||||||||
./*.rpm | ||||||||
!./*-debuginfo-*.rpm | ||||||||
|
||||||||
release: | ||||||||
name: Create release | ||||||||
runs-on: ubuntu-latest | ||||||||
needs: [build, package] | ||||||||
steps: | ||||||||
- uses: actions/download-artifact@v4 | ||||||||
with: | ||||||||
merge-multiple: true | ||||||||
path: artifacts/ | ||||||||
- uses: softprops/action-gh-release@v1 | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||
with: | ||||||||
files: | | ||||||||
# List to exclude pdb | ||||||||
artifacts/openlauncher | ||||||||
artifacts/openlauncher*.exe | ||||||||
artifacts/openlauncher*.rpm | ||||||||
artifacts/openlauncher*.deb |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
[Desktop Entry] | ||
|
||
# The type as listed above | ||
Type=Application | ||
|
||
# The version of the desktop entry specification to which this file complies | ||
Version=1.0 | ||
|
||
# The name of the application | ||
Name=OpenLauncher | ||
|
||
# A comment which can/will be used as a tooltip | ||
Comment=A launcher for automatically downloading the latest, or specific versions of OpenRCT2 and OpenLoco. | ||
|
||
# The path to the folder in which the executable is run | ||
Path=/usr/bin | ||
|
||
# The executable of the application, possibly with arguments. | ||
Exec=openlauncher | ||
|
||
# The name of the icon that will be used to display this entry | ||
Icon=openlauncher | ||
|
||
# Describes whether this application needs to be run in a terminal or not | ||
Terminal=false | ||
|
||
# Describes the categories in which this entry should be shown | ||
Categories=Game; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.