-
Notifications
You must be signed in to change notification settings - Fork 17
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
Create deb and rpm automatically #25
Open
samuel-w
wants to merge
2
commits into
OpenRCT2:master
Choose a base branch
from
samuel-w:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||||||||
with: | ||||||||
files: | | ||||||||
# List to exclude pdb | ||||||||
artifacts/openlauncher | ||||||||
artifacts/openlauncher*.exe | ||||||||
artifacts/openlauncher*.rpm | ||||||||
artifacts/openlauncher*.deb |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.