Skip to content

Commit

Permalink
added a github action
Browse files Browse the repository at this point in the history
  • Loading branch information
neoapps-dev authored Dec 14, 2024
1 parent e490b42 commit 355d55c
Showing 1 changed file with 58 additions and 0 deletions.
58 changes: 58 additions & 0 deletions .github/workflows/build-and-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: Build and Publish BuildIt Release

on:
workflow_dispatch: # hope this works :)

jobs:
build:
runs-on: ubuntu-latest

strategy:
matrix:
os: [windows-latest, ubuntu-latest, macos-latest]
rust: [stable]

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Set up Rust
uses: actions/setup-rust@v1
with:
rust-version: stable

- name: Install cargo-bundle
run: cargo install cargo-bundle

- name: Build for ${{ matrix.os }}
run: |
if [ "${{ matrix.os }}" == "windows-latest" ]; then
cargo build --release --target x86_64-pc-windows-msvc
elif [ "${{ matrix.os }}" == "macos-latest" ]; then
cargo build --release --target x86_64-apple-darwin
else
cargo build --release --target x86_64-unknown-linux-gnu
fi
- name: Archive release binaries
run: |
if [ "${{ matrix.os }}" == "windows-latest" ]; then
mkdir release && mv target/x86_64-pc-windows-msvc/release/* release/
elif [ "${{ matrix.os }}" == "macos-latest" ]; then
mkdir release && mv target/x86_64-apple-darwin/release/* release/
else
mkdir release && mv target/x86_64-unknown-linux-gnu/release/* release/
fi
- name: Create Release
uses: softprops/action-gh-release@v1
with:
files: release/*
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Create Release Description
run: |
curl -X PATCH -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
-d '{"body": "v1.0!!"}' \
"https://api.github.com/repos/${{ github.repository }}/releases/latest"

0 comments on commit 355d55c

Please sign in to comment.