Skip to content

Commit

Permalink
fixed ci (#60)
Browse files Browse the repository at this point in the history
* fixed ci

* Update release.yml

Co-authored-by: Arman <[email protected]>
  • Loading branch information
armannaj and arman-purple authored Jun 24, 2022
1 parent 5661160 commit 254a843
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 197 deletions.
44 changes: 22 additions & 22 deletions .github/workflows/dotnet-core.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,67 +2,67 @@ name: .NET Core

on:
push:
branches: [master]
branches: [ main ]
pull_request:
branches: [master]
branches: [ main ]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: 6.0.x
- name: Install dependencies
run: dotnet restore
- name: Build
run: dotnet build --configuration Release --no-restore
- name: Test
run: dotnet test --no-restore --verbosity normal

- uses: actions/checkout@v2
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: 6.0.x
- name: Install dependencies
run: dotnet restore
- name: Build
run: dotnet build --configuration Release --no-restore
- name: Test
run: dotnet test --no-restore --verbosity normal
publish:
needs: build
if: github.ref == 'refs/heads/master'
if: github.ref == 'refs/heads/main'
runs-on: macos-latest
env:
releaseVersion: 0.0.0.${{ github.run_number }}
steps:
- uses: actions/checkout@v2
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: 6.0.x
- name: Install dependencies
run: dotnet restore
# Publish osx-x64
- name: Publish osx-x64
run: dotnet publish -r osx-x64 -c Release /p:PublishTrimmed=true
run: dotnet publish -r osx-x64 -p:Configuration=Release -p:DebugType=None -p:DebugSymbols=false -p:Version=${{env.releaseVersion}}
- name: Archive osx-x64
uses: actions/upload-artifact@v1
with:
name: PurpleExplorer_osx-x64
path: PurpleExplorer/bin/Release/net6.0/osx-x64/publish
# Publish osx-arm64
- name: Publish osx-arm64
run: dotnet publish -r osx-arm64 -c Release /p:PublishTrimmed=true
run: dotnet publish -r osx-arm64 -p:Configuration=Release -p:DebugType=None -p:DebugSymbols=false -p:Version=${{env.releaseVersion}}
- name: Archive osx-arm64
uses: actions/upload-artifact@v1
with:
name: PurpleExplorer_osx-arm64
path: PurpleExplorer/bin/Release/net6.0/osx-arm64/publish
# Publish win-x64
- name: Publish win-x64
run: dotnet publish -r win-x64 -c Release /p:PublishTrimmed=true
run: dotnet publish -r win-x64 -p:Configuration=Release -p:DebugType=None -p:DebugSymbols=false -p:Version=${{env.releaseVersion}}
- name: Archive win-x64
uses: actions/upload-artifact@v1
with:
name: PurpleExplorer_win-x64
path: PurpleExplorer/bin/Release/net6.0/win-x64/publish
# Publish linux-x64
- name: Publish linux-x64
run: dotnet publish -r linux-x64 -c Release /p:PublishTrimmed=true
run: dotnet publish -r linux-x64 -p:Configuration=Release -p:DebugType=None -p:DebugSymbols=false -p:Version=${{env.releaseVersion}}
- name: Archive linux-x64
uses: actions/upload-artifact@v1
with:
name: PurpleExplorer_linux-x64
path: PurpleExplorer/bin/Release/net6.0/linux-x64/publish
path: PurpleExplorer/bin/Release/net6.0/linux-x64/publish
18 changes: 8 additions & 10 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ on:
inputs:
majorVersion:
required: true
default: "0"
default: '0'
minorVersion:
required: true
default: "1"
default: '1'

jobs:
publish:
if: github.ref == 'refs/heads/master'
if: github.ref == 'refs/heads/main'
runs-on: macos-latest
env:
releaseVersion: ${{ github.event.inputs.majorVersion }}.${{ github.event.inputs.minorVersion }}.${{ github.run_number }}
Expand All @@ -24,26 +24,24 @@ jobs:
uses: actions/setup-dotnet@v1
with:
dotnet-version: 6.0.x
- name: Install dependencies
run: dotnet restore
# Publish osx-x64
- name: Publish osx-x64
run: dotnet publish -r osx-x64 -c Release /p:PublishTrimmed=true /p:Version=${{env.releaseVersion}}
run: dotnet publish -r osx-x64 -p:Configuration=Release -p:DebugType=None -p:DebugSymbols=false -p:Version=${{env.releaseVersion}}
- name: Zip osx-x64
run: (cd PurpleExplorer/bin/Release/net6.0/osx-x64/publish ; zip -r PurpleExplorer_osx-x64.zip *)
# Publish osx-arm64
- name: Publish osx-arm64
run: dotnet publish -r osx-arm64 -c Release /p:PublishTrimmed=true /p:Version=${{env.releaseVersion}}
run: dotnet publish -r osx-arm64 -p:Configuration=Release -p:DebugType=None -p:DebugSymbols=false -p:Version=${{env.releaseVersion}}
- name: Zip osx-arm64
run: (cd PurpleExplorer/bin/Release/net6.0/osx-arm64/publish ; zip -r PurpleExplorer_osx-arm64.zip *)
# Publish win-x64
- name: Publish win-x64
run: dotnet publish -r win-x64 -c Release /p:PublishTrimmed=true /p:Version=${{env.releaseVersion}}
run: dotnet publish -r win-x64 -p:Configuration=Release -p:DebugType=None -p:DebugSymbols=false -p:Version=${{env.releaseVersion}}
- name: Zip win-x64
run: (cd PurpleExplorer/bin/Release/net6.0/win-x64/publish ; zip -r PurpleExplorer_win-x64 *)
# Publish linux-x64
- name: Publish linux-x64
run: dotnet publish -r linux-x64 -c Release /p:PublishTrimmed=true /p:Version=${{env.releaseVersion}}
run: dotnet publish -r linux-x64 -p:Configuration=Release -p:DebugType=None -p:DebugSymbols=false -p:Version=${{env.releaseVersion}}
- name: Zip linux-x64
run: (cd PurpleExplorer/bin/Release/net6.0/linux-x64/publish ; zip -r PurpleExplorer_linux-x64 *)
# Create release
Expand Down Expand Up @@ -96,4 +94,4 @@ jobs:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: PurpleExplorer/bin/Release/net6.0/linux-x64/publish/PurpleExplorer_linux-x64.zip
asset_name: PurpleExplorer_linux-x64.zip
asset_content_type: application/zip
asset_content_type: application/zip
68 changes: 0 additions & 68 deletions PurpleExplorer/.github/workflows/dotnet-core.yml

This file was deleted.

97 changes: 0 additions & 97 deletions PurpleExplorer/.github/workflows/release.yml

This file was deleted.

0 comments on commit 254a843

Please sign in to comment.