Merge pull request #9 from CassioJhones/dev #22
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
name: Deploy FolderFlex | |
on: | |
push: | |
branches: ['master'] | |
paths-ignore: | |
- 'README.md' | |
- 'social_preview.jpg' | |
- 'docs/**' | |
- '.github/workflows/dotnet-desktop.yml' | |
- 'dotnet-desktop.yml' | |
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 | |
- name: Publicando FolderFlex | |
run: dotnet publish FolderFlex/FolderFlex.csproj --configuration ${{ matrix.configuration }} --output ./output/ | |
- name: Criando Pasta para os Arquivos | |
run: | | |
mkdir ./output/FolderFlexFiles | |
Move-Item ./output/* ./output/FolderFlexFiles/ -Force | |
- name: Compactando Arquivos | |
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 v1.0.${{ github.run_number }} | |
git push origin v1.0.${{ github.run_number }} | |
- name: Criando Nova Release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: 5.0.${{ github.run_number }} | |
release_name: "FolderFlex v5.0.${{ github.run_number }}" | |
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 |