Skip to content

Commit de59a79

Browse files
authored
Merge pull request #153 from ionite34/avalonia
2 parents 20413f4 + 3cc64cc commit de59a79

File tree

339 files changed

+17986
-1773
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

339 files changed

+17986
-1773
lines changed

.github/workflows/release.yml

Lines changed: 139 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -2,69 +2,177 @@ name: Release
22

33
on:
44
workflow_dispatch:
5+
inputs:
6+
version:
7+
type: string
8+
description: Version (Semver without leading v)
9+
sentry-release:
10+
type: boolean
11+
description: Make Sentry Release?
12+
default: false
13+
514
release:
615
types: [ published ]
716

817
jobs:
9-
release:
10-
if: github.repository == 'ionite34/StabilityMatrix'
11-
runs-on: windows-latest
12-
18+
release-linux:
19+
if: github.repository == 'ionite34/StabilityMatrix' || github.event_name == 'workflow_dispatch'
20+
name: Release (linux-x64)
21+
env:
22+
platform-id: linux-x64
23+
out-name: StabilityMatrix.AppImage
24+
runs-on: ubuntu-latest
1325
steps:
1426
- uses: actions/checkout@v3
1527

1628
- uses: olegtarasov/get-tag@v2.1.2
29+
if: github.event_name == 'release'
1730
id: tag_name
1831
with:
1932
tagRegex: "v(.*)"
20-
21-
- name: Set Tag
33+
34+
- name: Set Version from Tag
35+
if: github.event_name == 'release'
2236
run: |
2337
echo "Using tag ${{ env.GIT_TAG_NAME }}"
24-
echo "RELEASE_VERSION=${{ env.GIT_TAG_NAME }}.0" >> $env:GITHUB_ENV
38+
echo "RELEASE_VERSION=${{ env.GIT_TAG_NAME }}" >> $GITHUB_ENV
39+
40+
- name: Set Version from manual input
41+
if: github.event_name == 'workflow_dispatch'
42+
run: |
43+
echo "Using version ${{ github.event.inputs.version }}"
44+
echo "RELEASE_VERSION=${{ github.event.inputs.version }}" >> $GITHUB_ENV
2545
26-
- name: Set up .NET
46+
- name: Set up .NET 6 (for PupNet)
2747
uses: actions/setup-dotnet@v3
2848
with:
2949
dotnet-version: '6.0.x'
50+
51+
- name: Install PupNet
52+
run: |
53+
sudo apt-get -y install libfuse2
54+
dotnet tool install --framework net6.0 -g KuiperZone.PupNet
3055
31-
- name: Install dependencies
32-
run: dotnet restore -p:PublishReadyToRun=true
33-
34-
- name: Build
56+
- name: Set up .NET 7
57+
uses: actions/setup-dotnet@v3
58+
with:
59+
dotnet-version: '7.0.x'
60+
61+
- name: PupNet Build
3562
env:
3663
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
37-
run: >
38-
dotnet publish ./StabilityMatrix/StabilityMatrix.csproj
39-
-o out -c Release -r win-x64
40-
-p:Version=$env:RELEASE_VERSION -p:FileVersion=$env:RELEASE_VERSION -p:AssemblyVersion=$env:RELEASE_VERSION
41-
-p:PublishReadyToRun=true -p:PublishSingleFile=true
42-
-p:SentryOrg=${{ secrets.SENTRY_ORG }} -p:SentryProject=${{ secrets.SENTRY_PROJECT }}
43-
-p:SentryUploadSymbols=true -p:SentryUploadSources=true
44-
--self-contained true
45-
46-
- name: Remove old artifacts
47-
uses: c-hive/gha-remove-artifacts@v1
48-
with:
49-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
50-
age: '90 seconds'
51-
skip-tags: false
64+
run: pupnet -r linux-x64 -c Release --kind appimage --app-version $RELEASE_VERSION --clean -y
65+
# Release/linux-x64/StabilityMatrix.x86_64.AppImage
5266

67+
- name: Post Build
68+
run: mv ./Release/linux-x64/StabilityMatrix.x86_64.AppImage ${{ env.out-name }}
69+
5370
- name: Upload Artifact
5471
uses: actions/upload-artifact@v2
5572
with:
56-
name: StabilityMatrix
57-
path: ./out/StabilityMatrix.exe
73+
name: StabilityMatrix-${{ env.platform-id }}
74+
path: ${{ env.out-name }}
5875

5976
- name: Create Sentry release
60-
if: ${{ env.MAKE_SENTRY_RELEASE == 'true' }}
77+
if: ${{ github.event_name == 'release' }}
6178
uses: getsentry/action-release@v1
6279
env:
63-
MAKE_SENTRY_RELEASE: ${{ secrets.SENTRY_PROJECT != '' }}
80+
MAKE_SENTRY_RELEASE: ${{ secrets.SENTRY_PROJECT != '' }}
6481
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
6582
SENTRY_ORG: ${{ secrets.SENTRY_ORG }}
6683
SENTRY_PROJECT: ${{ secrets.SENTRY_PROJECT }}
6784
with:
6885
environment: production
6986
ignore_missing: true
7087
version: StabilityMatrix@${{ env.GIT_TAG_NAME }}
88+
89+
- name: Create Sentry release
90+
if: ${{ github.event_name == 'workflow_dispatch' }}
91+
uses: getsentry/action-release@v1
92+
env:
93+
MAKE_SENTRY_RELEASE: ${{ secrets.SENTRY_PROJECT != '' }}
94+
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
95+
SENTRY_ORG: ${{ secrets.SENTRY_ORG }}
96+
SENTRY_PROJECT: ${{ secrets.SENTRY_PROJECT }}
97+
with:
98+
environment: production
99+
ignore_missing: true
100+
version: StabilityMatrix@${{ github.event.inputs.version }}
101+
102+
103+
release-windows:
104+
if: github.repository == 'ionite34/StabilityMatrix' || github.event_name == 'workflow_dispatch'
105+
name: Release (win-x64)
106+
env:
107+
platform-id: win-x64
108+
runs-on: windows-latest
109+
steps:
110+
- uses: actions/checkout@v3
111+
112+
- uses: olegtarasov/get-tag@v2.1.2
113+
if: github.event_name == 'release'
114+
id: tag_name
115+
with:
116+
tagRegex: "v(.*)"
117+
118+
- name: Set Version from Tag
119+
if: github.event_name == 'release'
120+
run: |
121+
echo "Using tag ${{ env.GIT_TAG_NAME }}"
122+
echo "RELEASE_VERSION=${{ env.GIT_TAG_NAME }}" >> $env:GITHUB_ENV
123+
124+
- name: Set Version from manual input
125+
if: github.event_name == 'workflow_dispatch'
126+
run: |
127+
echo "Using version ${{ github.event.inputs.version }}"
128+
echo "RELEASE_VERSION=${{ github.event.inputs.version }}" >> $env:GITHUB_ENV
129+
130+
- name: Set up .NET 7
131+
uses: actions/setup-dotnet@v3
132+
with:
133+
dotnet-version: '7.0.x'
134+
135+
- name: Install dependencies
136+
run: dotnet restore
137+
138+
- name: .NET Publish
139+
env:
140+
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
141+
run: >
142+
dotnet publish ./StabilityMatrix.Avalonia/StabilityMatrix.Avalonia.csproj
143+
-o out -c Release -r ${{ env.platform-id }}
144+
-p:Version=$env:RELEASE_VERSION
145+
-p:PublishSingleFile=true -p:IncludeNativeLibrariesForSelfExtract=true
146+
-p:PublishTrimmed=true
147+
-p:SentryOrg=${{ secrets.SENTRY_ORG }} -p:SentryProject=${{ secrets.SENTRY_PROJECT }}
148+
-p:SentryUploadSymbols=true -p:SentryUploadSources=true
149+
150+
- name: Post Build
151+
run: mv ./out/StabilityMatrix.Avalonia.exe ./out/${{ env.out-name }}
152+
153+
- name: Upload Artifact
154+
uses: actions/upload-artifact@v2
155+
with:
156+
name: StabilityMatrix-${{ env.platform-id }}
157+
path: ./out/${{ env.out-name }}
158+
159+
160+
cleanup:
161+
name: Artifact Cleanup
162+
needs: [release-linux, release-windows]
163+
if: github.repository == 'ionite34/StabilityMatrix'
164+
runs-on: ubuntu-latest
165+
continue-on-error: true
166+
167+
steps:
168+
- name: Remove old artifacts
169+
uses: c-hive/gha-remove-artifacts@v1
170+
with:
171+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
172+
age: '1 hour'
173+
skip-recent: 2
174+
skip-tags: false
175+
176+
- name: Output
177+
if: always() && true
178+
run: exit 0

Jenkinsfile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,23 +20,23 @@ node("Windows") {
2020
stage('Set Version') {
2121
script {
2222
if (env.TAG_NAME) {
23-
version = env.TAG_NAME.replaceFirst(/^v/, '') + ".0"
23+
version = env.TAG_NAME.replaceFirst(/^v/, '')
2424
} else {
25-
version = VersionNumber projectStartDate: '2023-06-21', versionNumberString: '1.0.${BUILDS_ALL_TIME}.0', versionPrefix: '', worstResultForIncrement: 'SUCCESS'
25+
version = VersionNumber projectStartDate: '2023-06-21', versionNumberString: '${BUILDS_ALL_TIME}', worstResultForIncrement: 'SUCCESS'
2626
}
2727
}
2828
}
2929

3030
stage('Publish') {
31-
bat "dotnet publish .\\StabilityMatrix\\StabilityMatrix.csproj -c Release -o out -r win-x64 -p:PublishSingleFile=true -p:Version=${version} -p:FileVersion=${version} -p:AssemblyVersion=${version} --self-contained true"
31+
bat "dotnet publish .\\StabilityMatrix.Avalonia\\StabilityMatrix.Avalonia.csproj -c Release -o out -r win-x64 -p:PublishSingleFile=true -p:VersionPrefix=2.0.0 -p:VersionSuffix=${version} -p:IncludeNativeLibrariesForSelfExtract=true"
3232
}
3333

3434
stage ('Archive Artifacts') {
3535
archiveArtifacts artifacts: 'out/*.exe', followSymlinks: false
3636
}
3737
} else {
3838
stage('Publish') {
39-
bat "dotnet publish .\\StabilityMatrix\\StabilityMatrix.csproj -c Release -o out -r win-x64 -p:PublishSingleFile=true --self-contained true"
39+
bat "dotnet publish .\\StabilityMatrix.Avalonia\\StabilityMatrix.Avalonia.csproj -c Release -o out -r win-x64 -p:PublishSingleFile=true -p:IncludeNativeLibrariesForSelfExtract=true"
4040
}
4141
}
4242
}

Jenkinsfile-linux

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
node("Diligence") {
2+
def repoName = "StabilityMatrix"
3+
def author = "ionite34"
4+
def version = ""
5+
6+
stage('Clean') {
7+
deleteDir()
8+
}
9+
10+
stage('Checkout') {
11+
git branch: env.BRANCH_NAME, credentialsId: 'Ionite', url: "https://github.com/${author}/${repoName}.git"
12+
}
13+
14+
// stage('Test') {
15+
// sh "dotnet test StabilityMatrix.Tests"
16+
// }
17+
18+
if (env.BRANCH_NAME == 'main') {
19+
20+
stage('Set Version') {
21+
script {
22+
if (env.TAG_NAME) {
23+
version = env.TAG_NAME.replaceFirst(/^v/, '')
24+
} else {
25+
version = VersionNumber projectStartDate: '2023-06-21', versionNumberString: '${BUILDS_ALL_TIME}', worstResultForIncrement: 'SUCCESS'
26+
}
27+
}
28+
}
29+
30+
stage('Publish') {
31+
sh "/home/jenkins/.dotnet/tools/pupnet --runtime linux-x64 --kind appimage --app-version ${version} --clean -y"
32+
}
33+
34+
stage ('Archive Artifacts') {
35+
archiveArtifacts artifacts: 'out/*.appimage', followSymlinks: false
36+
}
37+
} else {
38+
stage('Publish') {
39+
sh "/home/jenkins/.dotnet/tools/pupnet --runtime linux-x64 --kind appimage --clean -y"
40+
}
41+
}
42+
}

0 commit comments

Comments
 (0)