From 22139ffd3bf2effc98790d2762966bbc539f7130 Mon Sep 17 00:00:00 2001 From: Alvin Dimas Date: Thu, 10 Oct 2024 08:30:37 +0700 Subject: [PATCH] Create build.yml --- .github/workflows/build.yml | 42 +++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..bbfc48f --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,42 @@ +name: Build Executable + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + workflow_dispatch: + inputs: + tag: + description: Release git tag + type: string + required: true + +env: + CARGO_TERM_COLOR: always + +jobs: + build: + runs-on: macos-13 + permissions: + contents: write + packages: write + pull-requests: write + repository-projects: write + steps: + - uses: actions/checkout@v4 + - name: Build + run: cargo build --verbose + - name: Rename + run: mv target/amdhelper-tui target/amdhelper + - name: Publish release + if: ${{ github.event_name == 'workflow_dispatch' }} + uses: ncipollo/release-action@v1 + with: + artifacts: ./target/amdhelper + tag: ${{ inputs.tag }} + name: AMDHelper ${{ inputs.tag }} + allowUpdates: true + artifactErrorsFailBuild: false + prerelease: true + token: ${{ secrets.GITHUB_TOKEN }}