2023-05-16 15:45:11 -05:00
|
|
|
name: Build
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches: [ "master" ]
|
2023-05-17 05:30:14 -05:00
|
|
|
tags:
|
|
|
|
- 'v*'
|
2023-05-16 15:45:11 -05:00
|
|
|
pull_request:
|
|
|
|
branches: [ "master" ]
|
|
|
|
|
|
|
|
env:
|
|
|
|
CARGO_TERM_COLOR: always
|
2023-05-16 16:42:05 -05:00
|
|
|
CARGO_TERM_PROGRESS_WHEN: never
|
2023-05-16 15:45:11 -05:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
2023-05-17 05:30:14 -05:00
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
os: [ubuntu-latest, windows-latest]
|
|
|
|
runs-on: ${{ matrix.os }}
|
2023-05-16 15:45:11 -05:00
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v3
|
2023-05-16 16:50:53 -05:00
|
|
|
- uses: awalsh128/cache-apt-pkgs-action@v1.3.0
|
2023-05-17 05:30:14 -05:00
|
|
|
if: runner.os == 'Linux'
|
2023-05-16 16:50:53 -05:00
|
|
|
with:
|
|
|
|
packages: libudev-dev
|
|
|
|
version: 1.0
|
|
|
|
- uses: Swatinem/rust-cache@v2.3.0
|
2023-05-16 15:45:11 -05:00
|
|
|
- name: Build
|
2023-05-16 16:33:17 -05:00
|
|
|
run: cargo build
|
|
|
|
--release
|
|
|
|
--bin kubi
|
|
|
|
--bin kubi-server
|
2023-05-16 17:16:49 -05:00
|
|
|
- name: Create artifact
|
2023-05-17 05:30:14 -05:00
|
|
|
shell: bash
|
2023-05-16 17:17:39 -05:00
|
|
|
run: |
|
|
|
|
mkdir artifact;
|
|
|
|
cp ./target/release/kubi ./artifact;
|
|
|
|
cp ./target/release/kubi-server ./artifact;
|
|
|
|
cp -r ./assets ./artifact;
|
2023-05-16 17:28:55 -05:00
|
|
|
cp ./Server.toml ./artifact;
|
2023-05-16 15:45:11 -05:00
|
|
|
- uses: actions/upload-artifact@v3
|
|
|
|
with:
|
2023-05-17 05:32:55 -05:00
|
|
|
name: ${{ runner.os }}_${{ runner.arch }}
|
2023-05-16 17:21:35 -05:00
|
|
|
path: ./artifact/*
|
2023-05-16 17:16:49 -05:00
|
|
|
if-no-files-found: error
|
2023-05-17 05:30:14 -05:00
|
|
|
|
2023-05-17 21:42:52 -05:00
|
|
|
publish-nightly:
|
|
|
|
needs: build
|
2023-05-17 21:48:02 -05:00
|
|
|
permissions: write-all
|
2023-05-18 19:34:14 -05:00
|
|
|
if: (github.event_name == 'push') && (github.ref == 'refs/heads/master')
|
2023-05-17 21:42:52 -05:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/download-artifact@v2
|
|
|
|
with:
|
|
|
|
path: ./artifacts
|
2023-05-18 20:00:31 -05:00
|
|
|
- uses: rickstaa/action-create-tag@v1
|
|
|
|
with:
|
|
|
|
tag: nightly
|
|
|
|
tag_exists_error: false
|
|
|
|
force_push_tag: true
|
2023-05-17 22:00:05 -05:00
|
|
|
- name: Create zip files
|
|
|
|
run: |
|
|
|
|
cd ./artifacts;
|
|
|
|
for folder in */;
|
|
|
|
do zip -r "${folder%/}.zip" "$folder";
|
|
|
|
rm -rf "$folder"
|
|
|
|
done;
|
|
|
|
cd ..;
|
2023-05-17 21:42:52 -05:00
|
|
|
- uses: ncipollo/release-action@v1
|
|
|
|
with:
|
|
|
|
name: nightly
|
|
|
|
tag: nightly
|
2023-05-18 19:34:14 -05:00
|
|
|
commit: ${GITHUB_SHA}
|
2023-05-17 21:42:52 -05:00
|
|
|
allowUpdates: true
|
|
|
|
removeArtifacts: true
|
|
|
|
replacesArtifacts: true
|
|
|
|
prerelease: true
|
|
|
|
generateReleaseNotes: true
|
|
|
|
updateOnlyUnreleased: true
|
2023-05-17 22:00:05 -05:00
|
|
|
artifacts: ./artifacts/*
|
2023-05-17 21:42:52 -05:00
|
|
|
|
2023-05-17 05:30:14 -05:00
|
|
|
publish-release:
|
|
|
|
needs: build
|
2023-05-17 21:48:02 -05:00
|
|
|
permissions: write-all
|
2023-05-18 19:34:14 -05:00
|
|
|
if: (github.event_name == 'push') && startsWith(github.ref, 'refs/tags/v')
|
2023-05-17 05:30:14 -05:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/download-artifact@v2
|
|
|
|
with:
|
|
|
|
path: ./artifacts
|
2023-05-17 22:00:05 -05:00
|
|
|
- name: Create zip files
|
|
|
|
run: |
|
|
|
|
cd ./artifacts;
|
|
|
|
for folder in */;
|
|
|
|
do zip -r "${folder%/}.zip" "$folder";
|
|
|
|
rm -rf "$folder"
|
|
|
|
done;
|
|
|
|
cd ..;
|
2023-05-17 05:53:00 -05:00
|
|
|
- uses: rlespinasse/github-slug-action@v4.4.1
|
2023-05-17 05:30:14 -05:00
|
|
|
- uses: ncipollo/release-action@v1
|
|
|
|
with:
|
|
|
|
tag: ${{ env.GITHUB_REF_SLUG_URL }}
|
2023-05-17 21:42:52 -05:00
|
|
|
generateReleaseNotes: true
|
2023-05-17 05:30:14 -05:00
|
|
|
makeLatest: true
|
|
|
|
artifacts: ./artifacts/*
|