Skip to content

Commit

Permalink
Automatically create and upload release artifacts
Browse files Browse the repository at this point in the history
Fixes #20

When a new tag is pushed, build updated artifacts and then create and upload them to a a new release using the same template text for the release description as in the link in the [release checklist for matHELICS](https://github.com/GMLC-TDC/HELICS/blob/main/.github/RELEASE_CHECKLIST_TEMPLATE.md).
  • Loading branch information
nightlark committed Oct 10, 2024
1 parent add2f15 commit d408710
Showing 1 changed file with 30 additions and 3 deletions.
33 changes: 30 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@ name: Test matHELICS

on:
push:
tags:
- 'v*.*.*'
- main
pull_request:
branches:
- main
workflow_dispatch:
#schedule:
# - cron: "35 10 * * 1,3,5 # running early in the morning (UTC)

jobs:
ci-test:
Expand Down Expand Up @@ -39,11 +40,18 @@ jobs:
uses: matlab-actions/run-command@v2
with:
command: buildHelicsInterface('helics',true)
- name: Rename artifact
run: |
if [[ ${{ runner.os }} == 'Windows' ]]; then
mv matHELICS.zip matHELICS-${{ matrix.os }}.zip
else
mv matHELICS.tar.gz matHELICS-${{ matrix.os }}.tar.gz
fi
- name: store package
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.os }}-matHELICS
path: matHELICS.*
path: matHELICS-${{ matrix.os }}.*
- name: run startup
uses: matlab-actions/run-command@v2
with:
Expand All @@ -53,3 +61,22 @@ jobs:
with:
command: addpath('tests'),addpath('helics'),runAllTests

release:
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
needs: ci-test
steps:
- name: Download artifact
uses: actions/download-artifact@v4
with:
name: *-matHELICS
path: ./artifacts
merge-multiple: true
- name: Create Release
uses: softprops/action-gh-release@v2
with:
make_latest: true
tag_name: ${{ github.ref }}
name: ${{ github.ref }}
body: Release for [HELICS ${{ github.ref }}](https://github.com/GMLC-TDC/HELICS/releases/tag/${{ github.ref }})
files: ./artifacts/matHELICS-${{ matrix.os }}.*

0 comments on commit d408710

Please sign in to comment.