Skip to content

Commit

Permalink
Add build action
Browse files Browse the repository at this point in the history
  • Loading branch information
VOID404 committed Jul 9, 2024
1 parent fa79864 commit 638fdbd
Showing 1 changed file with 49 additions and 0 deletions.
49 changes: 49 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Build
on:
push:
tags: ["v*.*.*"]
workflow_dispatch:

permissions:
contents: write

jobs:
build:
name: "Build ${{ matrix.platform.target }}"
runs-on: ${{ matrix.platform.os }}
strategy:
fail-fast: false
matrix:
platform:
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
- os: windows-latest
target: x86_64-pc-windows-msvc
- os: macos-latest
target: aarch64-apple-darwin
- os: macos-latest
target: x86_64-apple-darwin
steps:
- name: checkout
uses: actions/checkout@v1
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
default: true
target: ${{ matrix.platform.target }}
- name: Build artifacts
run: |
echo "::group::Cargo build"
cargo build --target ${{ matrix.platform.target }} --release
echo ::endgroup::
echo ::group::tar
tar -C target/${{ matrix.platform.target }}/release/ -czvf makedot-${{ matrix.platform.target }}.tar.gz makedot${{ runner.os == 'Windows' && '.exe' || '' }}
echo ::endgroup::
- name: Upload Release Assets
if: ${{ github.event_name != 'workflow_dispatch' }}
uses: softprops/action-gh-release@v1
with:
files: '*.tar.gz'
token: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 638fdbd

Please sign in to comment.