-
Notifications
You must be signed in to change notification settings - Fork 119
91 lines (81 loc) · 2.75 KB
/
release.yml
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
89
90
91
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 }}
rel_tag: ${{ env.REL_TAG }}
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 [email protected]
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: ncipollo/release-action@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag: ${{ env.REL_TAG }}
name: Release ${{ env.REL_TAG }}
prerelease: true
nrn-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 nrn-full-src-package
id: tar
run: |
tar -czvf nrn-full-src-package-${REL_TAG}.tar.gz nrn
echo "asset_file=nrn-full-src-package-${REL_TAG}.tar.gz" >> $GITHUB_OUTPUT
- name: Upload nrn-full-src-package to release
run: |
gh release upload ${{ needs.tag-n-release.outputs.rel_tag }} ${{ steps.tar.outputs.asset_file }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
windows-installer:
needs: tag-n-release
uses: neuronsimulator/nrn/.github/workflows/windows.yml@master
with:
tag: ${{ needs.tag-n-release.outputs.rel_tag }}