Skip to content

Commit

Permalink
try auto release
Browse files Browse the repository at this point in the history
  • Loading branch information
Frefreak committed Dec 28, 2023
1 parent bf5a768 commit 4e5ede6
Showing 1 changed file with 48 additions and 32 deletions.
80 changes: 48 additions & 32 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,35 +3,51 @@ name: Rust Build
on: [push]

jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
targets: ['x86_64-unknown-linux-musl', 'x86_64-unknown-linux-gnu']

steps:
- uses: actions/checkout@v2
with:
submodules: true

- name: Install Rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
override: true

- name: Install musl-tools
run: sudo apt-get update && sudo apt-get install -y musl-tools

- name: Build
run: |
rustup target add ${{ matrix.targets }}
cargo build --release --target=${{ matrix.targets }}
- name: Archive production artifacts
uses: actions/upload-artifact@v2
with:
name: otk-${{ matrix.targets }}
path: ./target/${{ matrix.targets }}/release/otk
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
targets: ['x86_64-unknown-linux-musl', 'x86_64-unknown-linux-gnu']

steps:
- uses: actions/checkout@v2
with:
submodules: true

- name: Install Rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
override: true

- name: Install musl-tools
run: sudo apt-get update && sudo apt-get install -y musl-tools

- name: Build
run: |
rustup target add ${{ matrix.targets }}
cargo build --release --target=${{ matrix.targets }}
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.sha }}
release_name: $(date +%Y-%m-%d)-${{ github.sha }}
draft: false
prerelease: false

- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./target/${{ matrix.targets }}/release/otk
asset_name: otk-${{ matrix.targets }}
asset_content_type: application/octet-stream

0 comments on commit 4e5ede6

Please sign in to comment.