Prevent creating variables with keywords as names. #55
This file contains hidden or 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: CI | |
on: | |
workflow_dispatch: | |
inputs: {} | |
push: | |
branches: [ main ] | |
paths-ignore: | |
- '.github/**' | |
- 'docs/**' | |
- 'assets/**' | |
- '.vscode/**' | |
- '*.yml' | |
- '*.json' | |
- '*.md' | |
- '.gitignore' | |
- '.gitattributes' | |
env: | |
BASE_VERSION: "1.0" | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
name: "Checkout code" | |
- name: Get version info | |
id: version_info | |
shell: bash | |
run: | | |
echo "build_version=${{ env.BASE_VERSION }}.${{ github.run_number }}" >> $GITHUB_OUTPUT | |
echo "prev_build_version=${{ env.BASE_VERSION }}.$((${{ github.run_number }} - 1))" >> $GITHUB_OUTPUT | |
echo "git_short_hash=$(git rev-parse --short "${{ github.sha }}")" >> $GITHUB_OUTPUT | |
- uses: actions/setup-dotnet@v4 | |
name: "Install .NET SDK" | |
with: | |
global-json-file: global.json | |
- name: Compile & publish | |
shell: bash | |
run: | | |
cd src/Lib | |
dotnet build -c Release -o ../../nuget_build -p:Version="${{ steps.version_info.outputs.build_version }}" | |
cd ../../ | |
dotnet nuget push "nuget_build/Starscript.Net.${{ steps.version_info.outputs.build_version }}.nupkg" --source nuget.org --api-key ${{ secrets.NUGETORG_API_KEY }} |