-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6cb8cd7
commit 9273246
Showing
2 changed files
with
69 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
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 |
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