Release Version 0.49 #215
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 create version tag | |
on: | |
push: | |
branches: | |
- main | |
workflow_dispatch: | |
jobs: | |
build: | |
strategy: | |
matrix: | |
os: [windows-latest, ubuntu-latest, macos-latest] | |
include: | |
- os: windows-latest | |
extension: ".zip" | |
runtime: "win-x64" | |
- os: ubuntu-latest | |
extension: ".tar.gz" | |
runtime: "linux-x64" | |
- os: macos-latest | |
runtime: "osx-x64" | |
extension: ".zip" | |
node_version: [18] | |
fail-fast: false | |
runs-on: ${{ matrix.os }} | |
env: | |
PROJECT_NAME: "Angor" | |
SOLUTION_PATH: "src/Angor.sln" | |
PROJECT_PATH: "src/Angor/Server/Angor.Server.csproj" | |
BUILD_CONFIGURATION: "Release" | |
steps: | |
- uses: actions/checkout@v2 | |
name: Checkout | |
- name: Setup dotnet | |
uses: actions/setup-dotnet@v1 | |
with: | |
dotnet-version: | | |
8.0.x | |
- name: Setup Node.js (${{ matrix.node_version }}) | |
uses: actions/setup-node@v1 | |
with: | |
node-version: ${{ matrix.node_version }} | |
- name: Variables | |
run: | | |
echo VERSION=$(npm run version --silent) >> $GITHUB_ENV | |
shell: bash | |
- name: Workload | |
run: dotnet workload restore ${{env.SOLUTION_PATH}} | |
- name: Restore | |
run: dotnet restore ${{env.SOLUTION_PATH}} | |
- name: Unit Test | |
run: dotnet test -v=normal -c ${{env.BUILD_CONFIGURATION}} ${{env.SOLUTION_PATH}} | |
- name: Check for changes in Directory.Build.props | |
if: matrix.os == 'ubuntu-latest' | |
id: check_changes | |
run: | | |
if git diff --name-only HEAD^ HEAD | grep -q '^src/Directory.Build.props$'; then | |
echo "true" > change_detected.txt | |
else | |
echo "false" > change_detected.txt | |
fi | |
- name: Upload change detection result | |
if: matrix.os == 'ubuntu-latest' | |
uses: actions/upload-artifact@v2 | |
with: | |
name: change-detection-result | |
path: change_detected.txt | |
finalize: | |
runs-on: ubuntu-latest | |
needs: build | |
steps: | |
- name: Download change detection result | |
uses: actions/download-artifact@v2 | |
with: | |
name: change-detection-result | |
path: . | |
- name: Check if any change detected | |
id: check_final | |
run: | | |
if grep -q "true" change_detected.txt; then | |
echo "change_detected=true" >> $GITHUB_ENV | |
else | |
echo "change_detected=false" >> $GITHUB_ENV | |
- name: Setup git | |
if: env.change_detected == 'true' | |
run: | | |
git config --global user.name "${{ github.actor }}" | |
git config --global user.email "${{ github.actor }}@users.noreply.github.com" | |
- name: Create tag | |
if: env.change_detected == 'true' | |
env: | |
TAG_NAME: "v${{ needs.build.outputs.VERSION }}" | |
run: | | |
sleep 10 | |
git tag $TAG_NAME | |
git push https://x-access-token:${{ secrets.ANGOR_DEPLOY_TOKEN }}@github.com/${{ github.repository }} $TAG_NAME |