Created release action (#3) #1
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: release | |
on: | |
push: | |
branches: [master, main] | |
tags: ["*"] | |
concurrency: production | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: '0' | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: '7.x' | |
- name: Install dependencies | |
run: dotnet restore | |
- name: Build | |
run: dotnet build | |
- name: Get next release version (dry run) | |
id: taggerDryRun | |
uses: anothrNick/[email protected] | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
WITH_V: true | |
DRY_RUN: true | |
- name: echo new tag | |
run: | | |
echo "The next tag version will be: ${{ steps.taggerDryRun.outputs.new_tag }}" | |
- name: echo tag | |
run: | | |
echo "The current tag is: ${{ steps.taggerDryRun.outputs.tag }}" | |
- name: Build | |
run: | | |
dotnet publish -c Release -r linux-x64 -o ./release/linux DotNetAstGen/DotNetAstGen.csproj | |
dotnet publish -c Release -r linux-arm -o ./release/linux-arm DotNetAstGen/DotNetAstGen.csproj | |
dotnet publish -c Release -r osx-x64 -o ./release/macos DotNetAstGen/DotNetAstGen.csproj | |
dotnet publish -c Release -r osx-arm64 -o ./release/macos-arm DotNetAstGen/DotNetAstGen.csproj | |
dotnet publish -c Release -r win-x64 -o ./release/win DotNetAstGen/DotNetAstGen.csproj | |
dotnet publish -c Release -r win-arm -o ./release/win-arm DotNetAstGen/DotNetAstGen.csproj | |
- name: Make executable | |
run: | | |
chmod +x ./release/macos/DotNetAstGen | |
chmod +x ./release/macos-arm/DotNetAstGen | |
chmod +x ./release/linux/DotNetAstGen | |
chmod +x ./release/linux-arm/DotNetAstGen | |
- name: ZIP Release Directory | |
run: | | |
mv ./release DotNetAstGen | |
zip -r DotNetAstGen.zip ./DotNetAstGen | |
- name: Set next release version | |
id: taggerFinal | |
uses: anothrNick/[email protected] | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
WITH_V: true | |
- name: Release | |
uses: softprops/action-gh-release@v1 | |
with: | |
tag_name: ${{ steps.taggerDryRun.outputs.new_tag }} | |
files: DotNetAstGen.zip |