Merge Add pre-release and update release action #2
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: Pre-release | |
on: | |
push: | |
branches: | |
- master | |
workflow_dispatch: | |
jobs: | |
pre-release: | |
runs-on: ubuntu-latest | |
name: Build vsix and upload to GitHub pre-release | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Install Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20.x | |
- name: Install .NET | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: "8.0" | |
- name: Get current version | |
run: | | |
VERSION=$(node -p "require('./package.json').version") | |
echo VERSION=$VERSION >> $GITHUB_ENV | |
echo VERSION_TAG=v$VERSION-${{ github.run_number }} >> $GITHUB_ENV | |
- name: Add GitHub NuGet Registry | |
run: dotnet nuget add source --username "${{ github.actor }}" --password "%GITHUB_TOKEN%" --store-password-in-clear-text --name github "https://nuget.pkg.github.com/GeoWerkstatt/index.json" | |
- name: Restore packages | |
run: dotnet restore ./language-server/src | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build language-server | |
run: dotnet build --no-restore "-p:VersionPrefix=${{ env.VERSION }}" ./language-server/src | |
- name: Run language-server tests | |
run: dotnet test --no-build ./language-server/src | |
- name: Publish language-server | |
run: | | |
for rid in win-x64 linux-x64 osx-x64 | |
do | |
dotnet publish ./language-server/src/Geowerkstatt.Interlis.LanguageServer --self-contained -c Release -r $rid "-p:VersionPrefix=${{ env.VERSION }}" -o ./language-server/bin/$rid | |
done | |
- name: Install packages | |
run: npm ci | |
- name: Pack extension | |
run: npx vsce pack --pre-release | |
- name: Create GitHub pre-release | |
run: gh release create ${{ env.VERSION_TAG }} --title "${{ env.VERSION_TAG }}" --notes "$(./get-changelog.sh)" --prerelease --target ${{ github.ref }} *.vsix | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |