Skip to content

Derive VersionString from assembly informational version (#44) #97

Derive VersionString from assembly informational version (#44)

Derive VersionString from assembly informational version (#44) #97

Workflow file for this run

name: Always be deploying
on:
pull_request:
paths-ignore:
- 'README.md'
- '.editorconfig'
push:
paths-ignore:
- 'README.md'
- '.editorconfig'
branches:
- master
tags:
- "*.*.*"
# Cancel superseded runs on the same branch/PR
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ !startsWith(github.ref, 'refs/tags/') }}
permissions:
contents: read
# ── AOT pack matrix ──────────────────────────────────────────────────────────
# Each leg compiles native-AOT for its RID and uploads the resulting nupkg.
# AOT compilation can only happen on a matching OS/arch, so we need a matrix.
jobs:
aot-pack:
strategy:
fail-fast: false # a preempted arm runner shouldn't cancel the whole matrix
matrix:
include:
- rid: linux-x64
runner: ubuntu-latest
- rid: linux-arm64
runner: ubuntu-24.04-arm
- rid: win-x64
runner: windows-latest
- rid: win-arm64
runner: windows-11-arm
- rid: osx-arm64
runner: macos-latest
runs-on: ${{ matrix.runner }}
name: AOT pack (${{ matrix.rid }})
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- run: |
git fetch --prune --tags
echo exit code $?
git tag --list
shell: bash
- uses: actions/setup-dotnet@v5
with:
dotnet-version: 10.0.x
- name: Install local tools
run: dotnet tool restore
- name: Pack native-AOT tool for ${{ matrix.rid }}
run: dotnet pack src/EditorConfig.App/EditorConfig.App.csproj -c Release -r ${{ matrix.rid }} -o build/output
shell: bash
- name: AOT smoke test — ${{ matrix.rid }}
shell: bash
run: |
# Run the native binary directly from the publish output (no `dotnet tool install`
# needed — the root package only exists in the coordinating build job).
EXT=""
[[ "$RUNNER_OS" == "Windows" ]] && EXT=".exe"
BINARY="src/EditorConfig.App/bin/Release/net10.0/${{ matrix.rid }}/publish/EditorConfig.App${EXT}"
OUTPUT=$("$BINARY" .editorconfig)
echo "editorconfig output: $OUTPUT"
echo "$OUTPUT" | grep -q "indent_style" || (echo "ERROR: expected indent_style in output" && exit 1)
- name: Upload per-RID package
if: github.event_name == 'push'
uses: actions/upload-artifact@v7
with:
name: nupkg-${{ matrix.rid }}
path: build/output/*.nupkg
if-no-files-found: error
# ── Managed build / pack / validate / publish ────────────────────────────────
build:
if: github.event_name == 'push'
runs-on: ubuntu-latest
needs: aot-pack
permissions:
contents: write # create GitHub release + push packages
packages: write # push to GitHub Packages
issues: write # release-notes tool creates labels for release note categories
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- run: |
git fetch --prune --tags
echo exit code $?
git tag --list
- uses: actions/setup-dotnet@v5
with:
dotnet-version: 10.0.x
source-url: https://nuget.pkg.github.com/editorconfig/index.json
env:
NUGET_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Build
run: ./build.sh build -s true
- name: Generate managed packages (lib + root tool with DotnetToolSettings.xml)
run: ./build.sh generatepackages -s true
- name: Download all per-RID AOT packages
uses: actions/download-artifact@v8
with:
pattern: nupkg-*
path: build/output
merge-multiple: true
- name: Validate managed packages
run: ./build.sh validatepackages -s true
- name: Inspect public API changes
run: ./build.sh generateapichanges -s true
- name: Publish to GitHub Package Registry (branch push)
if: github.event_name == 'push' && startsWith(github.ref, 'refs/heads')
shell: bash
run: |
until dotnet nuget push 'build/output/*.nupkg' \
-k ${{ secrets.GITHUB_TOKEN }} \
--skip-duplicate \
--no-symbols; do echo "Retrying"; sleep 1; done
- name: Generate release notes (tag push)
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
run: ./build.sh generatereleasenotes -s true
- name: Create GitHub release (tag push)
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
run: ./build.sh createreleaseongithub -s true --token ${{ secrets.GITHUB_TOKEN }}
- name: Publish to nuget.org (tag push)
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
run: |
dotnet nuget push 'build/output/*.nupkg' \
-k ${{ secrets.NUGET_ORG_API_KEY }} \
-s https://api.nuget.org/v3/index.json \
--skip-duplicate \
--no-symbols