Skip to content

Update build.yml

Update build.yml #16

Workflow file for this run

name: Build
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
env:
CARGO_TERM_COLOR: always
jobs:
build:
strategy:
matrix:
include:
- build: linux
os: ubuntu-latest
target: x86_64-unknown-linux-gnu
- build: macos
os: macos-latest
target: aarch64-apple-darwin
runs-on: ${{ matrix.os }}
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- name: Bump version and push tag
id: tag_version
uses: mathieudutour/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Get the release version from the tag
shell: bash
run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
- name: Build
run: cargo build --release --target ${{ matrix.target }}
- name: Build archive
shell: bash
run: |
# Replace with the name of your binary
binary_name="norminette_lsp"
bin_name="$binary_name-${{ env.VERSION }}-${{ matrix.target }}"
mv "target/${{ matrix.target }}/release/$binary_name" "$bin_name"
echo "ASSET=$bin_name" >> $GITHUB_ENV
- name: Release
uses: softprops/action-gh-release@v1
with:
files: |
${{ env.ASSET }}
# - name: Create a GitHub release
# uses: ncipollo/release-action@v1
# with:
# artifacts: "./target/release/norminette_lsp"
# tag: ${{ steps.tag_version.outputs.new_tag }}
# name: Release ${{ steps.tag_version.outputs.new_tag }} - ${{ matrix.os }}
# body: ${{ steps.tag_version.outputs.changelog }}