-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ci] Add automatic release creation on tag push
- Loading branch information
Showing
2 changed files
with
81 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,57 @@ | ||
# This file originaly comes from https://github.com/0x192/universal-android-debloater/blob/main/.github/workflows/build_artifacts.yml | ||
name: Build artifacts | ||
on: | ||
workflow_dispatch: | ||
workflow_call: | ||
|
||
jobs: | ||
build: | ||
name: Building ${{ matrix.build_target }} | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
include: | ||
- build_target: linux | ||
os: ubuntu-latest | ||
- build_target: macos | ||
os: macos-latest | ||
- build_target: windows | ||
os: windows-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: dtolnay/rust-toolchain@stable | ||
#- uses: rui314/setup-mold@v1 # faster linker | ||
# with: | ||
# make-default: false | ||
- uses: actions/cache@v3 | ||
with: | ||
path: | | ||
~/.cargo/bin/ | ||
~/.cargo/registry/index/ | ||
~/.cargo/registry/cache/ | ||
~/.cargo/git/db/ | ||
target | ||
key: ${{ runner.os }}-release-${{ hashFiles('**/Cargo.lock') }} | ||
restore-keys: ${{ runner.OS }}-release- | ||
if: matrix.os == 'ubuntu-latest' | ||
- name: Building | ||
run: cargo build --release | ||
- name: Creating ./bin directory | ||
run: mkdir -p bin | ||
- name: Renaming binaries [Windows] | ||
if: matrix.os == 'windows-latest' | ||
run: mv target/release/okbr.exe bin/okbr-${{ matrix.build_target }}.exe | ||
- name: Renaming binaries [Others] | ||
if: matrix.os != 'windows-latest' | ||
run: mv target/release/okbr bin/okbr-${{ matrix.build_target }} | ||
- name: Tarball Linux binary | ||
if: matrix.os == 'ubuntu-latest' | ||
run: tar --remove-files -czf bin/okbr-${{ matrix.build_target }}{.tar.gz,} | ||
- name: Zip MacOS binary | ||
if: matrix.os == 'macos-latest' | ||
run: zip -9rm bin/okbr-${{ matrix.build_target }}{.zip,} | ||
- name: Upload artifacts | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: okbr-${{ matrix.build_target }} | ||
path: bin/okbr-* |
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,24 @@ | ||
name: Build and release | ||
|
||
on: | ||
push: | ||
tags: | ||
- '*.*.*' | ||
|
||
jobs: | ||
build: | ||
uses: ./.github/workflows/build_artifacts.yml | ||
release: | ||
runs-on: ubuntu-latest | ||
needs: build | ||
steps: | ||
- uses: actions/checkout@master | ||
- name: Downloads artifacts | ||
uses: actions/download-artifact@v3 | ||
with: | ||
path: bin | ||
- name: Create draft release | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
files: bin/*/okbr-* | ||
draft: true |