-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
GitHub Actions for Automated Builds (#11)
* Create rust.yml * Update rust.yml * Added openssl as dependency * Update rust.yml * Create build-release.yml * Delete rust.yml * Update build-release.yml * Better release names * Update build-release.yml * Update build-release.yml * Reduce Windows release * Update Cargo.toml * Added Raspberry Pi Release * Update Cargo.toml * Better pi release naming
- Loading branch information
1 parent
d55737f
commit 672992d
Showing
2 changed files
with
93 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
name: release-binaries | ||
on: | ||
release: | ||
types: [published] | ||
env: | ||
BINARY_NAME: media-cleaner | ||
permissions: | ||
contents: write | ||
jobs: | ||
linux-x86_64: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- uses: actions-rs/toolchain@v1 | ||
with: | ||
profile: minimal | ||
toolchain: stable | ||
default: true | ||
|
||
- name: Build binary | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
command: build | ||
args: --release --target x86_64-unknown-linux-musl | ||
use-cross: true | ||
|
||
- name: Optimize and package binary | ||
run: | | ||
cd target/x86_64-unknown-linux-musl/release | ||
strip ${{ env.BINARY_NAME }} | ||
chmod +x ${{ env.BINARY_NAME }} | ||
tar -c ${{ env.BINARY_NAME }} | gzip > ${{ env.BINARY_NAME }}-${{ github.ref_name }}-linux-x86_64.tar.gz | ||
- name: Release | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
files: target/x86_64-unknown-linux-musl/release/${{ env.BINARY_NAME }}-${{ github.ref_name }}-linux-x86_64.tar.gz | ||
|
||
linux-armv7: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- uses: actions-rs/toolchain@v1 | ||
with: | ||
profile: minimal | ||
toolchain: stable | ||
default: true | ||
|
||
- name: Build binary | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
command: build | ||
args: --release --target armv7-unknown-linux-gnueabihf | ||
use-cross: true | ||
|
||
- name: Optimize and package binary | ||
run: | | ||
cd target/armv7-unknown-linux-gnueabihf/release | ||
chmod +x ${{ env.BINARY_NAME }} | ||
tar -c ${{ env.BINARY_NAME }} | gzip > ${{ env.BINARY_NAME }}-${{ github.ref_name }}-linux-armv7.tar.gz | ||
- name: Release | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
files: target/armv7-unknown-linux-gnueabihf/release/${{ env.BINARY_NAME }}-${{ github.ref_name }}-linux-armv7.tar.gz | ||
|
||
windows-x86_64: | ||
runs-on: windows-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- uses: actions-rs/toolchain@v1 | ||
with: | ||
profile: minimal | ||
toolchain: stable | ||
default: true | ||
|
||
- name: Build binary | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
command: build | ||
args: --release | ||
use-cross: true | ||
|
||
- run: Compress-Archive -Path target/release/${{ env.BINARY_NAME }}.exe -Destination ${{ env.BINARY_NAME }}-${{ github.ref_name }}-windows-x86_64.zip | ||
|
||
- name: Release | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
files: ${{ env.BINARY_NAME }}-${{ github.ref_name }}-windows-x86_64.zip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters