1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88
|
name: NEURON Release
on:
workflow_dispatch:
inputs:
rel_branch:
description: 'Release branch/commit'
default: 'release/x.y'
required: true
rel_tag:
description: 'Release version (tag name)'
default: 'x.y.z'
required: true
env:
GH_REPO: ${{ github.server_url }}/${{ github.repository }}
REL_TAG: ${{ github.event.inputs.rel_tag }}
REL_BRANCH: ${{ github.event.inputs.rel_branch }}
jobs:
tag-n-release:
runs-on: ubuntu-latest
name: tag-n-release ${{ github.event.inputs.rel_tag }} (${{ github.event.inputs.rel_branch }})
outputs:
release_url: ${{ steps.create_release.outputs.upload_url }}
steps:
- uses: actions/checkout@v4
name: Checkout branch ${{ env.REL_BRANCH }}
with:
ref: ${{ env.REL_BRANCH }}
- name: Create and upload tag ${{ env.REL_TAG }}
run: |
git config user.name github-actions
git config user.email github-actions@github.com
git tag -a $REL_TAG -m "${REL_TAG}"
git push origin $REL_TAG
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
working-directory: ${{runner.workspace}}/nrn
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ env.REL_TAG }}
release_name: Release ${{ env.REL_TAG }}
prerelease: true
full-src-package:
runs-on: ubuntu-latest
needs: tag-n-release
steps:
- name: Checkout feature-rich code
run: |
git clone --depth=1 --shallow-submodules --recurse-submodules $GH_REPO -b $REL_TAG --single-branch
cd nrn
LOCAL_TAG=`git tag`
if [ $REL_TAG != $LOCAL_TAG ]; then
echo "Wrong tag downloaded!"
exit 1
else
git log --oneline
fi
- name: Make nrnversion.h
run: |
mkdir build && cd build
cmake -DNRN_ENABLE_PYTHON=OFF -DNRN_ENABLE_RX3D=OFF -DNRN_ENABLE_MPI=OFF -DNRN_ENABLE_INTERVIEWS=OFF ../nrn
make nrnversion_h VERBOSE=1
- name: Create full-src-package
id: tar
run: |
tar -czvf ${REL_TAG}.tar.gz nrn
echo ::set-output name=asset_file::${REL_TAG}.tar.gz
- name: Upload full-src-package to release
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ needs.tag-n-release.outputs.release_url }}
asset_name: ${{ github.job }}-${{ steps.tar.outputs.asset_file }}
asset_content_type: application/gzip
asset_path: ${{ steps.tar.outputs.asset_file }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|