Skip to content

Commit

Permalink
Created release action (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidBakerEffendi authored Nov 24, 2023
1 parent 6cb8cd7 commit 9273246
Show file tree
Hide file tree
Showing 2 changed files with 69 additions and 0 deletions.
67 changes: 67 additions & 0 deletions .github/workflows/release.yml
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
2 changes: 2 additions & 0 deletions DotNetAstGen/DotNetAstGen.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
<TargetFramework>net7.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<SelfContained>true</SelfContained>
<PublishSingleFile>true</PublishSingleFile>
</PropertyGroup>

<ItemGroup>
Expand Down

0 comments on commit 9273246

Please sign in to comment.