Skip to content
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 48 additions & 10 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,27 +6,65 @@ on:
- 'v*.*.*' # Trigger on version tags

jobs:
release:
runs-on: ubuntu-latest
build:
strategy:
matrix:
include:
- os: ubuntu-latest
artifact_os: ubuntu
binary_path: sipnet
- os: macos-latest
artifact_os: macos
binary_path: sipnet
runs-on: ${{ matrix.os }}
steps:
# Checkout the repository
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v4

# Build SIPNET binary
- name: Build SIPNET
run: make
shell: bash

- name: Prepare release binary
shell: bash
run: |
tag="${GITHUB_REF_NAME}"
src="${{ matrix.binary_path }}"
dest="sipnet-${tag}-${{ matrix.artifact_os }}"

if [ ! -f "$src" ]; then
echo "Expected build artifact '${src}' not found" >&2
exit 1
fi

mkdir -p dist
mv "$src" "dist/${dest}"

- name: Upload release artifact
uses: actions/upload-artifact@v4
with:
name: sipnet-${{ github.ref_name }}-${{ matrix.artifact_os }}
path: dist/sipnet-${{ github.ref_name }}-${{ matrix.artifact_os }}
if-no-files-found: error

release:
needs: build
runs-on: ubuntu-latest
steps:
- name: Download release artifacts
uses: actions/download-artifact@v4
with:
path: dist
merge-multiple: true

# Create GitHub Release and Upload Asset
- name: Create Release and Upload Asset
id: create_release
- name: Create Release and Upload Assets
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ github.ref_name }}
release_name: Release ${{ github.ref_name }}
name: Release ${{ github.ref_name }}
body: |
This release includes the latest SIPNET binary.
draft: true # Create the release as a draft
files: ./sipnet # Path to the compiled binary
files: dist/*
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 2 additions & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ sections to include in release notes:

### Added

- Build and release binaries for MacOS and Windows on release (in addition to existing Linux builds)

### Fixed

### Changed
Expand Down
14 changes: 12 additions & 2 deletions docs/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -162,11 +162,21 @@ make -C tests/sipnet/test_events_infrastructure run
## Releases

- Use [Semantic Versioning v2](https://semver.org/) for SIPNET releases.
- Tag the git commit associated with the release `vX.Y.Z`.
- Update versions in:
- `CITATION.cff`
- `src/sipnet/version.h`
- `docs/CHANGELOG.md`
- `docs/Doxyfile` (`PROJECT_NUMBER`)
- Run tests (`make test`).
- Publish the GitHub release; include `docs/CHANGELOG.md` content in release notes.
- Tag the git commit associated with the release `vX.Y.Z` and push tag to master.
```
git tag v<X.Y.Z>
```
- Push tag to master branch, this will trigger a draft release
```
git push origin v0.0.0-test
```
- Open draft on https://github.com/pecanProject/sipnet/releases.
- Add content from `docs/CHANGELOG.md` to release notes.
- Publish the GitHub release; this will trigger archiving on Zenodo
- Get doi for this release from Zenodo and add to release notes. (note: README has a doi that represents all versions, and resolves to latest)