Skip to content

Commit

Permalink
add gitlab release-build workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
sheepish committed Jun 17, 2024
1 parent e8efcb0 commit ba7dfe2
Showing 1 changed file with 74 additions and 0 deletions.
74 changes: 74 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
name: Release
on:
workflow_dispatch:
push:
tags:
- '[0-9]+.[0-9]+.[0-9]+'
permissions:
contents: write
jobs:
build:
name: ${{ matrix.platform.os_name }} with rust ${{ matrix.toolchain }}
runs-on: ${{ matrix.platform.os }}
strategy:
fail-fast: false
matrix:
platform:
- os_name: Linux-x86_64
os: ubuntu-latest
target: x86_64-unknown-linux-gnu
bin_postfix: linux-amd64
# fails, cannot find openssl
#- os_name: Linux-aarch64
# os: ubuntu-latest
# target: aarch64-unknown-linux-gnu
# bin_postfix: linux-arm64
- os_name: Windows-x86_64
os: windows-latest
target: x86_64-pc-windows-msvc
bin_postfix: amd64.exe
- os_name: macOS-x86_64
os: macOS-latest
target: x86_64-apple-darwin
bin_postfix: darwin-amd64
- os_name: macOS-aarch64
os: macOS-latest
target: aarch64-apple-darwin
bin_postfix: darwin-arm64
toolchain:
- stable
steps:
- uses: actions/checkout@v4
- name: Use bundled sqlite3 (windows)
shell: pwsh
run: (Get-Content Cargo.toml) -replace '^(rusqlite = )(".*")$', '$1{ version = $2, features = ["bundled"] }' | Set-Content Cargo.toml
if: matrix.platform.os_name == 'Windows-x86_64'
- name: Build binary
uses: houseabsolute/actions-rust-cross@v0
with:
command: "build"
target: ${{ matrix.platform.target }}
toolchain: ${{ matrix.toolchain }}
args: "--release"
strip: true
- name: Rename builder (linux and macos)
run: mv target/${{ matrix.platform.target }}/release/ipwned-builder target/${{ matrix.platform.target }}/release/ipwned-builder-${{ matrix.platform.bin_postfix }}
if: matrix.platform.os_name != 'Windows-x86_64'
- name: Rename builder (windows)
run: mv target/${{ matrix.platform.target }}/release/ipwned-builder.exe target/${{ matrix.platform.target }}/release/ipwned-builder-${{ matrix.platform.bin_postfix }}
if: matrix.platform.os_name == 'Windows-x86_64'
- name: Rename server (linux and macos)
run: mv target/${{ matrix.platform.target }}/release/ipwned-server target/${{ matrix.platform.target }}/release/ipwned-server-${{ matrix.platform.bin_postfix }}
if: matrix.platform.os_name != 'Windows-x86_64'
- name: Rename server (windows)
run: mv target/${{ matrix.platform.target }}/release/ipwned-server.exe target/${{ matrix.platform.target }}/release/ipwned-server-${{ matrix.platform.bin_postfix }}
if: matrix.platform.os_name == 'Windows-x86_64'
- name: Generate SHA-256
run: shasum -a 256 target/${{ matrix.platform.target }}/release/ipwned-builder-${{ matrix.platform.bin_postfix }} target/${{ matrix.platform.target }}/release/ipwned-server-${{ matrix.platform.bin_postfix }} > target/${{ matrix.platform.target }}/release/${{ matrix.platform.bin_postfix }}.sha256
- name: Release binary and SHA-256 checksum to GitHub
uses: softprops/action-gh-release@v2
with:
files: |
target/${{ matrix.platform.target }}/release/ipwned-builder-${{ matrix.platform.bin_postfix }}
target/${{ matrix.platform.target }}/release/ipwned-server-${{ matrix.platform.bin_postfix }}
target/${{ matrix.platform.target }}/release/${{ matrix.platform.bin_postfix }}.sha256

0 comments on commit ba7dfe2

Please sign in to comment.