-
Notifications
You must be signed in to change notification settings - Fork 0
66 lines (57 loc) · 1.91 KB
/
Copy pathrelease.yml
File metadata and controls
66 lines (57 loc) · 1.91 KB
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
# This is a GitHub workflow, defining a set of jobs each with a set of steps.
#
# The workflow will run when a git tag like v1.2.3 is pushed, and publish a
# release to the chosen sysand index using trusted publishing.
#
# trusted publishing reference: https://docs.sysand.com/tutorial/setting-up-trusted-publishing
# workflow config reference: https://docs.github.com/en/actions/reference/workflows-and-actions/workflow-syntax
# installation script reference: https://client.sysand.com/getting-started/installation.html#macos-and-linux
#
name: Release
on:
push:
tags: ["v*"]
env:
SYSAND_INDEX_URL: https://sysand.com
PACKAGE_DIR: simulation_analysis
jobs:
test:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v6
- name: Install sysand
run: |
curl -fsSL https://sysand.com/install.sh | SYSAND_VERSION=latest sh
- name: Check version in git tag matches the project's declared version
run: |
cd ${PACKAGE_DIR}
PROJECT_VERSION="$(sysand info version)"
TAG_VERSION="${GITHUB_REF_NAME#v}"
if [ "$PROJECT_VERSION" != "$TAG_VERSION" ]; then
echo "Project version ${PROJECT_VERSION} does not match tag ${GITHUB_REF_NAME}"
exit 1
fi
publish:
runs-on: ubuntu-latest
needs: [test]
environment: sysand
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v6
- name: Install sysand
run: |
curl -fsSL https://sysand.com/install.sh | SYSAND_VERSION=latest sh
- name: Build and publish the project to the index
run: |
cd ${PACKAGE_DIR}
sysand build
sysand publish --index "${SYSAND_INDEX_URL}" -v
- name: Store kpars
uses: actions/upload-artifact@v7
with:
path: ./**/output/*.kpar
archive: false