Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidLee18 committed Sep 17, 2024
2 parents 27e8a02 + 9d42db2 commit f0a93e1
Showing 1 changed file with 74 additions and 0 deletions.
74 changes: 74 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
name: Build and Release

on:
push:
branches: [ "main" ]

env:
CARGO_TERM_COLOR: always

jobs:
update_version:
permissions:
contents: write
runs-on: ubuntu-latest
outputs:
new_tag: ${{ steps.tag_version.outputs.new_tag }}
steps:
- uses: actions/checkout@v4
- name: Bump version and push tag
id: tag_version
uses: mathieudutour/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
build_linux:
needs: update_version
runs-on: ubuntu-latest
# permissions:
# contents: write
steps:
- uses: actions/checkout@v4
- name: Build
run: cargo build --release --target x86_64-unknown-linux-gnu
- run: mv target/x86_64-unknown-linux-gnu/release/norminette_lsp norminette_lsp-x86_64-unknown-linux-gnu
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: x86_64-unknown-linux-gnu
path: norminette_lsp-x86_64-unknown-linux-gnu
build_macos:
needs: update_version
runs-on: macos-latest
# permissions:
# contents: write
steps:
- uses: actions/checkout@v4
- name: Build
run: cargo build --release --target aarch64-apple-darwin
- run: mv target/aarch64-apple-darwin/release/norminette_lsp norminette_lsp-aarch64-apple-darwin
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: aarch64-apple-darwin
path: norminette_lsp-aarch64-apple-darwin
release:
needs: [update_version, build_linux, build_macos]
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Download Linux Artifact
uses: actions/download-artifact@v4
with:
name: x86_64-unknown-linux-gnu
- name: Download macOS Artifact
uses: actions/download-artifact@v4
with:
name: aarch64-apple-darwin
- name: Release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ needs.update_version.outputs.new_tag }}
files: |
norminette_lsp-x86_64-unknown-linux-gnu
norminette_lsp-aarch64-apple-darwin

0 comments on commit f0a93e1

Please sign in to comment.