Skip to content

chore: bump version 18 1 #80

chore: bump version 18 1

chore: bump version 18 1 #80

Workflow file for this run

on:
push:
tags:
- "v*.*.*"
workflow_dispatch:
env:
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: true
jobs:
convert-release-as-draft:
name: Convert release to draft
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: chmod +x .hacking/scripts/convert_release_to_draft.sh
- run: .hacking/scripts/convert_release_to_draft.sh
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
check-versions-match:
name: Check versions match
runs-on: ubuntu-latest
needs:
- convert-release-as-draft
steps:
- uses: actions/checkout@v4
- name: Install jq
run: sudo apt-get install jq
- name: Allow running check_versions_match.sh
run: chmod +x ./.hacking/scripts/check_versions_match.sh
- name: Check release version matches code
run: |
RELEASE_VERSION=${{ github.event.release.tag_name }}
STRIPPED_VERSION=${RELEASE_VERSION#v}
./.hacking/scripts/check_versions_match.sh $STRIPPED_VERSION
release-vsix:
name: Release VSIX
runs-on: ubuntu-latest
needs:
- check-versions-match
steps:
- uses: actions/checkout@v4
- uses: Swatinem/rust-cache@v2
- uses: pnpm/action-setup@v4
name: Install pnpm
with:
version: 9
run_install: false
- name: Install Nodejs
uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"
cache: "pnpm"
- run: pnpm install --frozen-lockfile
- uses: dtolnay/rust-toolchain@stable
- run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
- run: cd editors/code && pnpm run build
- run: cd editors/code && pnpm run package
- name: Publish GitHub release
uses: softprops/action-gh-release@v2
with:
draft: true
files: |
editors/code/*.vsix
release:
name: Release ${{ matrix.platform.target }}
runs-on: ${{ matrix.platform.os }}
needs:
- check-versions-match
strategy:
fail-fast: false
matrix:
platform:
- name: sqruff-linux-x86_64-musl.tar.gz
os: ubuntu-20.04
target: x86_64-unknown-linux-musl
bin: sqruff
- name: sqruff-linux-aarch64-musl.tar.gz
os: ubuntu-20.04
target: aarch64-unknown-linux-musl
bin: sqruff
- name: sqruff-windows-x86_64.zip
os: windows-latest
target: x86_64-pc-windows-msvc
bin: sqruff.exe
- name: sqruff-darwin-x86_64.tar.gz
os: macos-13
target: x86_64-apple-darwin
bin: sqruff
- name: sqruff-darwin-aarch64.tar.gz
os: macOS-latest
target: aarch64-apple-darwin
bin: sqruff
steps:
- uses: actions/checkout@v4
- uses: Swatinem/rust-cache@v2
- name: Install musl-tools on Linux
run: sudo apt-get update --yes && sudo apt-get install --yes musl-tools
if: contains(matrix.platform.name, 'musl')
- name: Build binary
uses: houseabsolute/actions-rust-cross@v0
with:
command: build
target: ${{ matrix.platform.target }}
toolchain: stable
args: --locked --release
strip: true
- name: Package as archive
shell: bash
run: |
cd target/${{ matrix.platform.target }}/release
if [[ "${{ matrix.platform.os }}" == "windows-latest" ]]; then
7z a ../../../${{ matrix.platform.name }} ${{ matrix.platform.bin }}
else
tar czvf ../../../${{ matrix.platform.name }} ${{ matrix.platform.bin }}
fi
cd -
- name: Generate SHA-256 and Save to File
run: shasum -a 256 ${{ matrix.platform.name }} > ${{ matrix.platform.name }}.sha256
- name: Publish GitHub release
uses: softprops/action-gh-release@v2
with:
draft: true
files: |
sqruff-*
convert_release_to_not_draft:
name: Convert release to not draft
runs-on: ubuntu-latest
permissions: write-all
needs:
- release
- release-vsix
steps:
- uses: actions/checkout@v4
- run: chmod +x ./.hacking/scripts/convert_release_to_not_draft.sh
- run: ./.hacking/scripts/convert_release_to_not_draft.sh
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
update-homebrew-formula:
name: Update Homebrew Formula
runs-on: ubuntu-latest
needs: [convert_release_to_not_draft]
permissions: write-all
env:
HOMEBREW_ACCESS_TOKEN: ${{ secrets.HOMEBREW_ACCESS_TOKEN }}
steps:
- uses: actions/checkout@v4
- run: ./.hacking/scripts/update_homebrew_pr.sh $HOMEBREW_ACCESS_TOKEN
publish-to-cargo:
name: Publish to Cargo
runs-on: ubuntu-latest
needs: [convert_release_to_not_draft]
steps:
- uses: actions/checkout@v4
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
- name: Publish sqruff-lib to Cargo
uses: actions-rs/cargo@v1
with:
command: publish
args: --token ${{ secrets.CARGO_API_TOKEN }} -p sqruff-lib
- name: Publish sqruff-lsp to Cargo
uses: actions-rs/cargo@v1
with:
command: publish
args: --token ${{ secrets.CARGO_API_TOKEN }} -p sqruff-lsp
- name: Publish sqruff to Cargo
uses: actions-rs/cargo@v1
with:
command: publish
args: --token ${{ secrets.CARGO_API_TOKEN }} -p sqruff
publish-to-marketplace:
name: Publish VSIX to VSCode Marketplace
runs-on: ubuntu-latest
needs:
- release-vsix
- convert_release_to_not_draft
steps:
- uses: actions/checkout@v4
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"
- name: Install vsce
run: npm install -g vsce
- name: Download VSIX file
run: |
curl -L -o extension.vsix https://github.com/${{ github.repository }}/releases/download/${{ github.event.release.tag_name }}/editors/code/sqruff-${{ github.event.release.tag_name }}.vsix
- name: Publish to VSCode Marketplace
run: vsce publish --packagePath extension.vsix
env:
VSCE_PAT: ${{ secrets.VSCE_PAT }} # Set up the VSCE Personal Access Token in GitHub secrets