Prepare release 0.27.1 #37
Workflow file for this run
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: 📦 Prepare Release | |
| run-name: Prepare release ${{ github.ref_name }} | |
| on: | |
| push: | |
| tags: | |
| - '**' | |
| permissions: | |
| contents: write | |
| env: | |
| BUILD_VERSION: ${{ github.ref_name }} | |
| jobs: | |
| build-and-release: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: 10.0.100 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '22' | |
| - name: Build and test | |
| run: | | |
| dotnet restore FScript.sln | |
| dotnet build FScript.sln -c Release --no-restore | |
| dotnet test FScript.sln -c Release --no-build | |
| - name: Validate tag matches extension version | |
| shell: bash | |
| run: | | |
| TAG_VERSION="${GITHUB_REF_NAME}" | |
| EXT_VERSION=$(node -p "require('./vscode-fscript/package.json').version") | |
| if [ "$TAG_VERSION" != "$EXT_VERSION" ]; then | |
| echo "Tag version ($TAG_VERSION) does not match vscode-fscript/package.json version ($EXT_VERSION)." | |
| exit 1 | |
| fi | |
| - name: Install extension dependencies | |
| working-directory: vscode-fscript | |
| run: npm ci | |
| - name: Build and stage language server | |
| shell: bash | |
| run: | | |
| rm -rf vscode-fscript/server | |
| dotnet publish src/FScript.LanguageServer/FScript.LanguageServer.fsproj -c Release -o vscode-fscript/server | |
| - name: Install extension packaging tool | |
| run: npm install -g @vscode/vsce@3.5 | |
| - name: Package extension | |
| working-directory: vscode-fscript | |
| run: vsce package | |
| - name: Publish artifacts | |
| run: make publish-all config=Release version=${{ env.BUILD_VERSION }} | |
| - name: Pack release archives | |
| run: | | |
| (cd .out/dotnet; zip ../fscript-${BUILD_VERSION}-dotnet.zip ./*) | |
| (cd .out/windows/x64; zip ../../fscript-${BUILD_VERSION}-windows-x64.zip ./*) | |
| (cd .out/windows/arm64; zip ../../fscript-${BUILD_VERSION}-windows-arm64.zip ./*) | |
| (cd .out/linux/x64; zip ../../fscript-${BUILD_VERSION}-linux-x64.zip ./*) | |
| (cd .out/linux/arm64; zip ../../fscript-${BUILD_VERSION}-linux-arm64.zip ./*) | |
| cp entitlements.plist .out/darwin/entitlements.plist | |
| (cd .out/darwin; zip -r ../fscript-${BUILD_VERSION}-darwin-unsigned.zip ./*) | |
| - name: Extract version suffix | |
| run: | | |
| s=${{ github.ref_name }} | |
| pat="([^-]*)-?([^-]*)" | |
| [[ $s =~ $pat ]] | |
| BUILD_VERSION_SUFFIX=${BASH_REMATCH[2]} | |
| echo "BUILD_VERSION_SUFFIX=$BUILD_VERSION_SUFFIX" >> $GITHUB_ENV | |
| - name: Create draft GitHub release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: ${{ github.ref_name }} | |
| draft: true | |
| prerelease: ${{ env.BUILD_VERSION_SUFFIX != '' }} | |
| generate_release_notes: true | |
| files: | | |
| .out/*.zip | |
| .out/*.nupkg | |
| vscode-fscript/*.vsix |