-
Notifications
You must be signed in to change notification settings - Fork 2
96 lines (80 loc) · 2.93 KB
/
dotnet-desktop.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
name: Deploy FolderFlex
on:
push:
branches: ['master']
paths-ignore:
- 'README.md'
- 'social_preview.jpg'
- 'docs/**'
- '.github/workflows/dotnet-desktop.yml'
- 'dotnet-desktop.yml'
workflow_dispatch:
permissions:
contents: write
jobs:
build:
strategy:
matrix:
configuration: [Release]
runs-on: windows-latest
steps:
- name: Sincronizando Repositório
uses: actions/checkout@v4
- name: Configurando Ambiente .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x'
- name: Restaurando as dependências
run: dotnet restore FolderFlex.sln
- name: Compilando Tudo
run: dotnet build FolderFlex.sln --configuration ${{ matrix.configuration }} --no-restore /p:WarningLevel=0
- name: Publicando FolderFlex
run: dotnet publish FolderFlex/FolderFlex.csproj --configuration ${{ matrix.configuration }} --output ./output/
- name: Assembly do arquivo .csproj
id: get_version
run: |
[xml]$csproj = Get-Content "FolderFlex/FolderFlex.csproj"
$version = $csproj.Project.PropertyGroup.AssemblyVersion
if (-not $version) {
$version = $csproj.Project.PropertyGroup.FileVersion
}
echo "Version found: $version"
echo "VERSION=$version" >> $GITHUB_ENV
shell: C:\Program Files\PowerShell\7\pwsh.EXE -command ". '{0}'"
env:
DOTNET_ROOT: C:\Program Files\dotnet
- name: Criando Pasta para os Arquivos
run: |
mkdir ./output/FolderFlexFiles
- name: Movendo Arquivos para a Nova Pasta
run: |
Get-ChildItem ./output/ | Where-Object { $_.Name -ne 'FolderFlexFiles' } | Move-Item -Destination ./output/FolderFlexFiles/ -Force
- name: Compactando a Pasta
run: |
powershell Compress-Archive -Path ./output/FolderFlexFiles -DestinationPath ./output/FolderFlex.zip
- name: Criando Tag da versão
id: tag_version
run: |
git config --global user.name "GitHub Actions"
git config --global user.email "github-actions@github.com"
git tag "v${{ env.VERSION }}"
git push origin "v${{ env.VERSION }}"
- name: Criando Nova Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: "v${{ env.VERSION }}"
release_name: "FolderFlex v${{ env.VERSION }}"
draft: false
prerelease: true
- name: Anexando o artefato à release
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./output/FolderFlex.zip
asset_name: FolderFlex.zip
asset_content_type: application/zip