Skip to content

Commit

Permalink
add release workflow to test
Browse files Browse the repository at this point in the history
  • Loading branch information
krogenth committed Jul 15, 2023
1 parent 94ef27a commit 3ea556c
Show file tree
Hide file tree
Showing 3 changed files with 98 additions and 1 deletion.
1 change: 1 addition & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ indent_size = 2

# Other markup files
[*.{json,toml,xml,yml,yaml}]
indent_style = space
indent_size = 2

# Markdown files
Expand Down
97 changes: 97 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
name: Release Job

on:
push:
branches: [ switch-to-dotnet ]

env:
SOLUTION_FILE_PATH: .

jobs:
tag:
name: Create Release Tag
runs-on: ubuntu-latest
steps:
- name: Get Version Info
id: version_info
run: |
echo "build_version=${{ env.BASE_VERSION }}.${{ github.run_number }}" >> $GITHUB_OUTPUT
shell: bash

- name: Create Tag
uses: actions/github-script@v6
with:
script: |
github.rest.git.createRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: 'ref/tags/${{ steps.version_info.outputs.build_version }}',
sha: context.sha
})
release:
runs-on: ${{ matrix.os }}
environment: Release
strategy:
matrix:
dotnet-version: [ '7.0.x' ]
configuration: [ Release ]
os: [ ubuntu-latest, windows-latest ]
include:
- os: ubuntu-latest
OS_NAME: Linux x64
DOTNET_RUNTIME_IDENTIFIER: linux-x64
RELEASE_ZIP_OS_NAME: linux_x64

- os: windows-latest
OS_NAME: Windows x64
DOTNET_RUNTIME_IDENTIFIER: win10-x64
RELEASE_ZIP_OS_NAME: win_x64

steps:
- uses: actions/checkout@v3

- name: Setup .NET Core SDK ${{ matrix.dotnet-version }}
uses: actions/setup-dotnet@v3
with:
dotnet-version: ${{ matrix.dotnet-version }}

- name: Get Version Info
id: version_info
run: |
echo "build_version=${{ env.BASE_VERSION }}.${{ github.run_number }}" >> $GITHUB_OUTPUT
echo "git_short_hash=$(git rev-parse --short "${{ github.sha }}")" >> $GITHUB_OUTPUT
shell: bash

- name: Create Output Directory
run: mkdir release_output

- name: Run Publish
run: |
dotnet publish -c Release -r "${{ matrix.DOTNET_RUNTIME_IDENTIFIER }}" -o ./publish -p:Version="${{ steps.version_info.output.build_version }}" -p:SourceRevisionId="${{ steps.version_info.output.git_short_hash }}" -p:DebugType=embedded src/G2DataGUI --self-contained true
- name: Pack Windows Build
if : matrix.os == 'windows-latest'
run: |
pushd publish
7z a ../release_output/G2DataGUI-${{ steps.version_info.outputs.build_version }}-win_x64.zip publish
popd
shell: bash

- name: Pack Linux Build
if : matrix.os == 'ubuntu-latest'
run: |
pushd publish
tar -czvf ../release_output/G2DataGUI-${{ steps.version_info.outputs.build_version }}-linux_x64.tar.gz publish
popd
shell: bash

- name: Push Release
uses: ncipollo/release-action@v1
with:
name: ${{ steps.version_info.outputs.build_version }}
artifacts: "release_output/*.tar.gz,release_output/*.zip"
tag: ${{ steps.version_info.outputs.build_version }}
allowUpdates: true
omitBodyDuringUpdate: true
replacesArtifacts: true
1 change: 0 additions & 1 deletion src/G2DataGUI/UI/Views/Content/Bosses.axaml.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using Avalonia.Controls;

using FluentAvalonia.Core;
using FluentAvalonia.UI.Controls;

Expand Down

0 comments on commit 3ea556c

Please sign in to comment.