mirror of
https://github.com/nestriness/cdc-file-transfer.git
synced 2026-01-30 12:15:36 +02:00
Add workflow to create a release (#11)
Adds a workflow that creates a "latest" release with a description listing all changes and a zip with built binaries (for Windows and Ubuntu 20.04).
This commit is contained in:
101
.github/workflows/create_release.yml
vendored
Normal file
101
.github/workflows/create_release.yml
vendored
Normal file
@@ -0,0 +1,101 @@
|
||||
name: Create Release
|
||||
|
||||
on: [push]
|
||||
|
||||
jobs:
|
||||
Build-And-Test-Linux:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Initialize submodules
|
||||
run: git submodule update --init --recursive
|
||||
|
||||
- name: Build
|
||||
run: |
|
||||
bazel build --config=linux --compilation_mode=opt --linkopt=-Wl,--strip-all --copt=-fdata-sections --copt=-ffunction-sections --linkopt=-Wl,--gc-sections \
|
||||
//cdc_fuse_fs //cdc_rsync_server
|
||||
|
||||
- name: Test
|
||||
run: |
|
||||
bazel test --config=linux --compilation_mode=opt --linkopt=-Wl,--strip-all --copt=-fdata-sections --copt=-ffunction-sections --linkopt=-Wl,--gc-sections \
|
||||
--test_output=errors --local_test_jobs=1 \
|
||||
-- //... -//third_party/... -//cdc_rsync_server:file_finder_test
|
||||
|
||||
# The artifact collector doesn't like the fact that bazel-bin is a symlink.
|
||||
- name: Copy artifacts
|
||||
run: |
|
||||
mkdir artifacts
|
||||
cp bazel-bin/cdc_fuse_fs/cdc_fuse_fs artifacts
|
||||
cp bazel-bin/cdc_rsync_server/cdc_rsync_server artifacts
|
||||
cp bazel-bin/external/com_github_fuse/libfuse.so artifacts
|
||||
|
||||
- name: Upload artifacts
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: Linux-Artifacts
|
||||
path: artifacts
|
||||
|
||||
Build-And-Test-Windows:
|
||||
runs-on: windows-2019
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Initialize submodules
|
||||
run: git submodule update --init --recursive
|
||||
|
||||
- name: Build
|
||||
run: |
|
||||
bazel build --config=windows --compilation_mode=opt --copt=/GL `
|
||||
//cdc_rsync //cdc_stream //asset_stream_manager //tests_common //tests_asset_streaming_30 //tests_cdc_rsync
|
||||
|
||||
- name: Test
|
||||
run: |
|
||||
bazel-bin\tests_common\tests_common.exe
|
||||
bazel-bin\tests_asset_streaming_30\tests_asset_streaming_30.exe
|
||||
bazel-bin\tests_cdc_rsync\tests_cdc_rsync.exe
|
||||
bazel test --config=windows --compilation_mode=opt --copt=/GL --test_output=errors --local_test_jobs=1 `
|
||||
//asset_stream_manager/... `
|
||||
//cdc_fuse_fs/... `
|
||||
//cdc_rsync/... `
|
||||
//cdc_rsync/base/... `
|
||||
//cdc_rsync_server/... `
|
||||
//common/... `
|
||||
//data_store/... `
|
||||
//fastcdc/... `
|
||||
//manifest/... `
|
||||
//metrics/...
|
||||
|
||||
# The artifact collector doesn't like the fact that bazel-bin is a symlink.
|
||||
- name: Copy artifacts
|
||||
run: |
|
||||
mkdir artifacts
|
||||
cp bazel-bin/cdc_rsync/cdc_rsync.exe artifacts
|
||||
cp bazel-bin/cdc_stream/cdc_stream.exe artifacts
|
||||
cp bazel-bin/asset_stream_manager/asset_stream_manager.exe artifacts
|
||||
cp LICENSE artifacts
|
||||
cp README.md artifacts
|
||||
|
||||
- name: Upload artifacts
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: Windows-Artifacts
|
||||
path: artifacts
|
||||
|
||||
Create-Release:
|
||||
runs-on: ubuntu-latest
|
||||
needs: [Build-And-Test-Windows, Build-And-Test-Linux]
|
||||
steps:
|
||||
- name: Download artifacts
|
||||
uses: actions/download-artifact@v3
|
||||
|
||||
- name: Zip binaries
|
||||
run: zip -j binaries_x64.zip Windows-Artifacts/* Linux-Artifacts/*
|
||||
|
||||
- uses: "marvinpinto/action-automatic-releases@latest"
|
||||
with:
|
||||
repo_token: "${{ secrets.GITHUB_TOKEN }}"
|
||||
automatic_release_tag: "latest"
|
||||
prerelease: true
|
||||
title: "Development Build"
|
||||
files: binaries_x64.zip
|
||||
@@ -315,6 +315,9 @@ TEST_F(ProcessTest, LogOutputLevelDetection) {
|
||||
TEST_F(ProcessTest, Terminate) {
|
||||
ProcessStartInfo start_info;
|
||||
start_info.command = "timeout /T 30";
|
||||
// Prevents the process from shutting down immediately when run in background.
|
||||
// https://www.ibm.com/support/pages/timeout-command-run-batch-job-exits-immediately-and-returns-error-input-redirection-not-supported-exiting-process-immediately
|
||||
start_info.redirect_stdin = true;
|
||||
std::unique_ptr<Process> process = process_factory_.Create(start_info);
|
||||
EXPECT_OK(process->Start());
|
||||
EXPECT_EQ(process->ExitCode(), Process::kExitCodeStillRunning);
|
||||
@@ -325,6 +328,9 @@ TEST_F(ProcessTest, Terminate) {
|
||||
TEST_F(ProcessTest, TerminateAlreadyExited) {
|
||||
ProcessStartInfo start_info;
|
||||
start_info.command = "timeout /T 30";
|
||||
// Prevents the process from shutting down immediately when run in background.
|
||||
// https://www.ibm.com/support/pages/timeout-command-run-batch-job-exits-immediately-and-returns-error-input-redirection-not-supported-exiting-process-immediately
|
||||
start_info.redirect_stdin = true;
|
||||
std::unique_ptr<Process> process = process_factory_.Create(start_info);
|
||||
EXPECT_OK(process->Start());
|
||||
EXPECT_FALSE(process->HasExited());
|
||||
|
||||
Reference in New Issue
Block a user