Skip to content

chore: bump version 0.4.6 #33

chore: bump version 0.4.6

chore: bump version 0.4.6 #33

Workflow file for this run

on:
push:
tags:
- "v*.*.*"
workflow_dispatch:
jobs:
check-versions-match:
name: Check versions match
runs-on: ubuntu-latest
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/check_versions_match.sh
- name: Check release version matches code
run: |
RELEASE_VERSION=${{ github.event.release.tag_name }}
STRIPPED_VERSION=${RELEASE_VERSION#v}
./.hacking/check_versions_match.sh $STRIPPED_VERSION
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-latest
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: nightly
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-*
update-homebrew-formula:
name: Update Homebrew Formula
runs-on: ubuntu-latest
needs: release
permissions: write-all
steps:
- uses: actions/checkout@v4
- run: HOMEBREW_ACCESS_TOKEN=${{ secrets.HOMEBREW_ACCESS_TOKEN }} ./.hacking/update_homebrew_pr.sh $HOMEBREW_ACCESS_TOKEN
publish-to-cargo:
name: Publish to Cargo
runs-on: ubuntu-latest
needs: [release, check-versions-match]
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 to Cargo
uses: actions-rs/cargo@v1
with:
command: publish
args: --token ${{ secrets.CARGO_API_TOKEN }} -p sqruff