Skip to content

Commit

Permalink
Add 'helics-release-build' dispatch event trigger (#1123)
Browse files Browse the repository at this point in the history
* Add a helics-release-build event to build release binaries

* Try without wrapping event context in ${{}}

* Remove use of matrix for conditional builds

* Use no tag for on-demand source archive builds

* Switch 'all' keyword to 'everything'

'all' collided with 'installer'

* Update CHANGELOG.md
  • Loading branch information
nightlark committed Mar 6, 2020
1 parent 972fe3b commit 5857a77
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 6 deletions.
36 changes: 30 additions & 6 deletions .github/workflows/release-build.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
name: Build release artifacts

on:
# Handles a 'helics-release-build' dispatch event type
# The event payload should contain these fields:
# packages - a list of which packages to build (everything, archive, msvc, installer, sharedlib)
# commit (optional) - the commit-ish to do a release build with
repository_dispatch:
schedule:
- cron: '15 09 * * *' # Run at in the early hours of the morning (UTC)
release:
Expand All @@ -13,15 +18,25 @@ jobs:
create-all-submodule-archive:
name: Create all submodule archive
runs-on: ubuntu-latest
if: github.event.action == 'published'
if: (github.event.action == 'published') || (github.event.action == 'helics-release-build' && (contains(github.event.client_payload.packages, 'archive') || contains(github.event.client_payload.packages, 'everything')))
steps:
- uses: actions/checkout@v2
- name: Checkout event ref
uses: actions/checkout@v2
with:
ref: ${{ github.event.client_payload.commit }}
if: github.event.action == 'published' || github.event.action == 'helics-release-build'

- name: Create archive
if: github.event.action != 'helics-release-build'
# Creates the archive then moves it to an artifact subfolder
run: ./scripts/_git-all-archive.sh -l "$(git rev-parse --abbrev-ref "${GITHUB_REF}")" && mkdir artifact && mv "Helics-$(git rev-parse --abbrev-ref "${GITHUB_REF}")-source.tar.gz" artifact/

- name: Create archive (no version)
if: github.event.action == 'helics-release-build'
# Creates the archive then moves it to an artifact subfolder
run: ./scripts/_git-all-archive.sh && mkdir artifact && mv "Helics-source.tar.gz" artifact/

- name: Upload archive to release
if: github.event.action != 'helics-release-build'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
UPLOAD_URL: ${{ github.event.release.upload_url }}
Expand All @@ -38,6 +53,7 @@ jobs:
#####################################
build-windows-msvc:
runs-on: ${{ matrix.os }}
if: (github.event.action != 'helics-release-build') || (contains(github.event.client_payload.packages, 'msvc') || contains(github.event.client_payload.packages, 'everything'))
strategy:
matrix:
os: [windows-2016, windows-latest]
Expand All @@ -52,7 +68,9 @@ jobs:
steps:
- name: Checkout event ref
uses: actions/checkout@v2
if: github.event.action == 'published'
with:
ref: ${{ github.event.client_payload.commit }}
if: github.event.action == 'published' || github.event.action == 'helics-release-build'

- name: Checkout develop branch
uses: actions/checkout@v2
Expand Down Expand Up @@ -96,6 +114,7 @@ jobs:
build-installers:
runs-on: ${{ matrix.os }}
name: Build ${{ matrix.os }} ${{ matrix.arch }} ${{ matrix.cpack_gen }} Installer
if: (github.event.action != 'helics-release-build') || (contains(github.event.client_payload.packages, 'installer') || contains(github.event.client_payload.packages, 'everything'))
strategy:
matrix:
id: [windows-x64, windows-x86, macos-x64, linux-x64]
Expand Down Expand Up @@ -125,7 +144,9 @@ jobs:
steps:
- name: Checkout event ref
uses: actions/checkout@v2
if: github.event.action == 'published'
with:
ref: ${{ github.event.client_payload.commit }}
if: github.event.action == 'published' || github.event.action == 'helics-release-build'

- name: Checkout develop branch
uses: actions/checkout@v2
Expand Down Expand Up @@ -183,6 +204,7 @@ jobs:
#####################################
build-sharedlibs:
runs-on: ${{ matrix.os }}
if: (github.event.action != 'helics-release-build') || (contains(github.event.client_payload.packages, 'sharedlib') || contains(github.event.client_payload.packages, 'everything'))
name: Build ${{ matrix.os }} ${{ matrix.arch }} Shared Library
strategy:
matrix:
Expand All @@ -209,7 +231,9 @@ jobs:
steps:
- name: Checkout event ref
uses: actions/checkout@v2
if: github.event.action == 'published'
with:
ref: ${{ github.event.client_payload.commit }}
if: github.event.action == 'published' || github.event.action == 'helics-release-build'

- name: Checkout develop branch
uses: actions/checkout@v2
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ Increased code coverage and additional bug fixes. The error propagation in HELI
- `helics_terminate_on_error` flag to escalate what would be a local error into a global one that will halt the co-simulation. This flag can be specified through the flag to federates or to brokers and cores through a command line option `--terminate_on_error`
- `addDependency` function was added to the C++ Federate API and shared library API, it can add a direct dependency between federates manually.
- A 32-bit Windows zip install archive for releases
- Support for a 'helics-release-build' event trigger to the release build GitHub Actions workflow

### Deprecated

Expand Down

0 comments on commit 5857a77

Please sign in to comment.