change release in action #6
Workflow file for this run
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: Build and Release | |
on: | |
push: | |
tags: | |
- 'v*.*.*' | |
jobs: | |
build: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest, windows-latest, macos-latest] | |
include: | |
- os: ubuntu-latest | |
zip_command: zip -r aws-service-authenticator-linux.zip ./publish | |
artifact_name: aws-service-authenticator-linux.zip | |
- os: windows-latest | |
zip_command: powershell Compress-Archive -Path ./publish/* -DestinationPath aws-service-authenticator-windows.zip | |
artifact_name: aws-service-authenticator-windows.zip | |
- os: macos-latest | |
zip_command: zip -r aws-service-authenticator-macos.zip ./publish | |
artifact_name: aws-service-authenticator-macos.zip | |
env: | |
SOLUTION_PATH: AwsServiceAuthenticator.sln | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: '8.0.x' | |
- name: Install dependencies | |
run: dotnet restore ${{ env.SOLUTION_PATH }} | |
- name: Build | |
run: dotnet build --configuration Release ${{ env.SOLUTION_PATH }} | |
- name: Publish | |
run: dotnet publish --configuration Release --output ./publish ${{ env.SOLUTION_PATH }} | |
- name: Create ZIP file | |
run: ${{ matrix.zip_command }} | |
- name: Archive release files | |
uses: actions/upload-artifact@v3 | |
with: | |
name: ${{ matrix.os }} | |
path: ${{ matrix.artifact_name }} | |
create_release: | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Download build artifacts (Linux) | |
uses: actions/download-artifact@v3 | |
with: | |
name: ubuntu-latest | |
path: ./downloads | |
- name: Download build artifacts (Windows) | |
uses: actions/download-artifact@v3 | |
with: | |
name: windows-latest | |
path: ./downloads | |
- name: Download build artifacts (macOS) | |
uses: actions/download-artifact@v3 | |
with: | |
name: macos-latest | |
path: ./downloads | |
- name: Create a release | |
id: create_release | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: | | |
./downloads/aws-service-authenticator-linux.zip | |
./downloads/aws-service-authenticator-windows.zip | |
./downloads/aws-service-authenticator-macos.zip | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |