Skip to content

chore: modernize CI deps and refresh README install section #3

chore: modernize CI deps and refresh README install section

chore: modernize CI deps and refresh README install section #3

Workflow file for this run

# GENERATED BY ./ci.ts -- DO NOT DIRECTLY EDIT
name: CI
on:
pull_request:
branches:
- main
push:
branches:
- main
tags:
- '*'
jobs:
build:
name: test_release
runs-on: macos-14
permissions:
contents: write
id-token: write
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- uses: denoland/setup-deno@667a34cdef165d8d2b2e98dde39547c9daac7282 # v2
- uses: actions/setup-dotnet@c2fa09f4bde5ebb9d1777cf28262a3eb3db3ced7 # v5
with:
dotnet-version: 10.0.x
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6
with:
node-version: 24.x
registry-url: 'https://registry.npmjs.org'
- name: Build (Debug)
run: dotnet build DprintPluginRoslyn
- name: Test
run: dotnet test
- name: Test Exe
run: cd test && cargo test
- name: Build (Release)
run: |-
dotnet build DprintPluginRoslyn -c Release --self-contained --runtime osx-x64
dotnet build DprintPluginRoslyn -c Release --self-contained --runtime osx-arm64
dotnet build DprintPluginRoslyn -c Release --self-contained --runtime linux-x64
dotnet build DprintPluginRoslyn -c Release --self-contained --runtime linux-musl-x64
dotnet build DprintPluginRoslyn -c Release --self-contained --runtime linux-arm64
dotnet build DprintPluginRoslyn -c Release --self-contained --runtime linux-musl-arm64
dotnet build DprintPluginRoslyn -c Release --self-contained --runtime win-x64
- name: Package
run: |-
RELEASE_DIR=$GITHUB_WORKSPACE/DprintPluginRoslyn/bin/Release/net10.0
cd $RELEASE_DIR/osx-x64
zip -r ../../../../../dprint-plugin-roslyn-x86_64-apple-darwin.zip ./*
cd $RELEASE_DIR/osx-arm64
zip -r ../../../../../dprint-plugin-roslyn-aarch64-apple-darwin.zip ./*
cd $RELEASE_DIR/linux-x64
zip -r ../../../../../dprint-plugin-roslyn-x86_64-unknown-linux-gnu.zip ./*
cd $RELEASE_DIR/linux-musl-x64
zip -r ../../../../../dprint-plugin-roslyn-x86_64-unknown-linux-musl.zip ./*
cd $RELEASE_DIR/linux-arm64
zip -r ../../../../../dprint-plugin-roslyn-aarch64-unknown-linux-gnu.zip ./*
cd $RELEASE_DIR/linux-musl-arm64
zip -r ../../../../../dprint-plugin-roslyn-aarch64-unknown-linux-musl.zip ./*
cd $RELEASE_DIR/win-x64
zip -r ../../../../../dprint-plugin-roslyn-x86_64-pc-windows-msvc.zip ./*
- name: Create plugin file
run: deno run --allow-read=. --allow-write=. scripts/create_plugin_file.ts
- name: Get tag version
id: get_tag_version
if: 'startsWith(github.ref, ''refs/tags/'')'
run: 'echo TAG_VERSION=${GITHUB_REF/refs\/tags\//} >> $GITHUB_OUTPUT'
- name: Get plugin file checksum
id: get_plugin_file_checksum
if: 'startsWith(github.ref, ''refs/tags/'')'
run: 'echo "CHECKSUM=$(shasum -a 256 plugin.json | awk ''{print $1}'')" >> $GITHUB_OUTPUT'
- name: Build npm packages
if: 'startsWith(github.ref, ''refs/tags/'')'
run: deno run -A scripts/create_npm_packages.ts
- name: Create release notes
if: 'startsWith(github.ref, ''refs/tags/'')'
run: 'deno run -A ./scripts/generate_release_notes.ts ${{ steps.get_tag_version.outputs.TAG_VERSION }} ${{ steps.get_plugin_file_checksum.outputs.CHECKSUM }} > ${{ github.workspace }}-CHANGELOG.txt'
- name: Release
uses: softprops/action-gh-release@de2c0eb89ae2a093876385947365aca7b0e5f844
if: 'startsWith(github.ref, ''refs/tags/'')'
env:
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
with:
files: |-
dprint-plugin-roslyn-x86_64-apple-darwin.zip
dprint-plugin-roslyn-aarch64-apple-darwin.zip
dprint-plugin-roslyn-x86_64-unknown-linux-gnu.zip
dprint-plugin-roslyn-x86_64-unknown-linux-musl.zip
dprint-plugin-roslyn-aarch64-unknown-linux-gnu.zip
dprint-plugin-roslyn-aarch64-unknown-linux-musl.zip
dprint-plugin-roslyn-x86_64-pc-windows-msvc.zip
plugin.json
body_path: '${{ github.workspace }}-CHANGELOG.txt'
draft: false
- name: Upgrade npm
if: 'startsWith(github.ref, ''refs/tags/'')'
run: npm install --global npm@latest
- name: Publish npm packages
if: 'startsWith(github.ref, ''refs/tags/'')'
run: deno run -A scripts/publish_npm_packages.ts