-
Notifications
You must be signed in to change notification settings - Fork 9
96 lines (94 loc) · 3.1 KB
/
build.yml
File metadata and controls
96 lines (94 loc) · 3.1 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
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
92
93
94
95
96
on:
push:
tags:
- "v*"
# should we prevent main branch build?
# warning about tag variable when not a tag push,
# devsim_win64_refs/heads/r2.9.2
#branches:
# - "r2.9.2"
#TODO: handle common code in build steps
jobs:
create_release_tag:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v5
with:
submodules: false
- name: Create Release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Use the default GITHUB_TOKEN
run: |
TAG=${GITHUB_REF#refs/tags/} # Extract the tag name from the ref
gh release create "$TAG" \
--prerelease \
--title "Release $TAG" \
--notes "Automated release for $TAG." \
--generate-notes # Automatically generate release notes based on commits
echo "Release $TAG created successfully."
build_windows:
if: true
name: Build on Windows
runs-on: windows-2025
needs: create_release_tag
steps:
- name: set git crlf
run: git config --global core.autocrlf input
- name: Set tags and variables
shell: bash
run: |
TAG=${GITHUB_REF#refs/tags/}
echo "TAG=$TAG" >> $GITHUB_ENV
echo "README_BASE_URL=https://github.com/devsim/symdiff/blob/${TAG}" >> $GITHUB_ENV
echo "PLATFORM=x64" >> $GITHUB_ENV
echo "CONDA_BIN=${CONDA}\\condabin\\conda.bat" >> $GITHUB_ENV
- name: Checkout repository
uses: actions/checkout@v5
with:
submodules: false
- name: compilation
shell: cmd
run: |
scripts\build_appveyor.bat %PLATFORM% %CONDA_BIN%
- name: Upload Release Asset ${{ runner.os }} ${{ runner.arch }}
shell: bash
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release upload "$TAG" *.whl
echo "Asset uploaded to release $TAG."
build_linux:
if: true
name: Build on Linux or macOS
needs: create_release_tag
strategy:
matrix:
os: [ubuntu-24.04, ubuntu-24.04-arm, macos-14]
runs-on: ${{matrix.os}}
steps:
- name: Checkout repository
uses: actions/checkout@v5
with:
submodules: false
- name: Set tag
run: |
TAG=${GITHUB_REF#refs/tags/}
echo "TAG=$TAG" >> $GITHUB_ENV
echo "README_BASE_URL=https://github.com/devsim/symdiff/blob/${TAG}" >> $GITHUB_ENV
- name: build ${{ runner.os }} ${{ runner.arch }}
run: |
if [ "$RUNNER_OS" == "Linux" ]; then
bash ./scripts/build_docker_manylinux_2_28.sh ${TAG};
elif [ "$RUNNER_OS" == "macOS" ]; then
bash ./scripts/build_macos.sh ${TAG};
else
echo "$RUNNER_OS not supported"
exit 1
fi
- name: Upload Release Asset ${{ runner.os }} ${{ runner.arch }}
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release upload "$TAG" *.whl
echo "Asset uploaded to release $TAG."