From d2b7824bcb547643d2a2f2bee63c17cd1d3aa077 Mon Sep 17 00:00:00 2001 From: Jamy Golden Date: Thu, 15 Feb 2024 12:42:28 +0100 Subject: [PATCH] Add build and release workflow based on git version tags Remove copy of non-existant file --- .github/workflows/release.yml | 58 +++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..5e7b5e6 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,58 @@ +name: Rust Multi-Platform Build and Release + +on: + push: + tags: + - "v*.*.*" + workflow_dispatch: + inputs: + tagName: + description: "Tag Name to Build" + required: true + +jobs: + build-and-release: + runs-on: ubuntu-latest + strategy: + matrix: + include: + - os: ubuntu-latest + target: x86_64-unknown-linux-gnu + - os: ubuntu-latest + target: i686-unknown-linux-gnu + - os: ubuntu-latest + target: aarch64-unknown-linux-gnu + - os: macos-latest + target: x86_64-apple-darwin + steps: + - uses: actions/checkout@v4 + + - name: Set up Rust + uses: actions-rs/toolchain@v1 + with: + toolchain: stable + target: ${{ matrix.target }} + profile: minimal + override: true + + - name: Build Release + run: cargo build --release --target ${{ matrix.target }} + + - name: Archive Production Artifacts + run: | + zip -r tinty-${{ matrix.target }}-${{ github.ref_name }}.zip ./target/${{ matrix.target }}/release/ + shell: bash + + - name: Upload Artifacts + uses: actions/upload-artifact@v2 + with: + name: tinty-${{ matrix.target }}-${{ github.ref_name }} + path: tinty-${{ matrix.target }}-${{ github.ref_name }}.zip + + - name: Release + if: startsWith(github.ref, "refs/tags/") + uses: softprops/action-gh-release@v1 + with: + files: tinty-*-${{ github.ref_name }}.zip + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}