Skip to content

Commit 221ee65

Browse files
authored
Issues/restructuring cmake (#375)
* restructuring cmake. * Restructured tests. * uber restructuring. * Fixing * need to make sure we are not shallow. * need to make sure we are not shallow. * Updating windows, changing name. * Restructuring some more for the tag process. * ok, this isn't much butter. * Ok, let's try this out. * adding a missing file. * incorrectly moved a file. * Removing old files. * wrong project source dir. * Adding the tests directory.
1 parent 00892b4 commit 221ee65

19 files changed

+514
-585
lines changed

.github/workflows/cmake.yml

Lines changed: 24 additions & 84 deletions
Original file line numberDiff line numberDiff line change
@@ -26,32 +26,29 @@ jobs:
2626
- {
2727
name: "Ubuntu Latest GCC",
2828
artifact: "CalChart.tar.xz",
29+
artifact_name: "CalChart-Linux.tar.xz",
2930
os: ubuntu-latest,
30-
build_type: "Release",
31-
cc: "gcc",
32-
cxx: "g++",
3331
}
3432
- {
3533
name: "macOS Latest Clang",
36-
artifact: "CalChart-3.6.2.dmg",
34+
artifact: "CalChart-*.dmg",
35+
artifact_name: "CalChart-macOS.dmg",
3736
os: macos-latest,
38-
build_type: "Release",
39-
cc: "clang",
40-
cxx: "clang++",
4137
}
4238
- {
4339
name: "Windows Latest MSVC",
44-
artifact: "CalChart-3.6.2.exe",
40+
artifact: "CalChart-*.exe",
41+
artifact_name: "CalChart-Windows.exe",
4542
os: windows-latest,
46-
build_type: "Release",
47-
cc: "cl",
48-
cxx: "cl",
4943
}
5044

5145
steps:
5246
- name: checkout
5347
uses: actions/checkout@v2
5448

49+
- name: Checkout unshallow
50+
run: git fetch --unshallow
51+
5552
- name: Checkout submodules
5653
run: git submodule update --init --recursive
5754

@@ -73,7 +70,7 @@ jobs:
7370
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
7471

7572
- name: Run tests
76-
run: ctest --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
73+
run: ctest --test-dir ${{github.workspace}}/build
7774

7875
- name: Pack (macOS)
7976
if: matrix.config.os == 'macos-latest'
@@ -93,87 +90,30 @@ jobs:
9390
run: cmake -E tar cJfv ${{github.workspace}}/build/CalChart.tar.xz .
9491

9592
- name: Upload
96-
uses: actions/upload-artifact@v1
93+
uses: actions/upload-artifact@v2
9794
with:
9895
path: ${{github.workspace}}/build/${{ matrix.config.artifact }}
99-
name: ${{ matrix.config.artifact }}
96+
name: ${{ matrix.config.artifact_name }}
10097

10198
release:
102-
if: contains(github.ref, 'tags/v')
103-
runs-on: ubuntu-latest
104-
needs: build
105-
106-
steps:
107-
- name: Create Release
108-
id: create_release
109-
uses: actions/[email protected]
110-
env:
111-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
112-
with:
113-
tag_name: ${{ github.ref }}
114-
release_name: Release ${{ github.ref }}
115-
draft: false
116-
prerelease: false
117-
118-
- name: Store Release url
119-
run: |
120-
echo "${{ steps.create_release.outputs.upload_url }}" > ./upload_url
121-
122-
- uses: actions/upload-artifact@v1
123-
with:
124-
path: ./upload_url
125-
name: upload_url
126-
127-
publish:
12899
if: contains(github.ref, 'tags/v')
129100
name: ${{ matrix.config.name }}
130-
runs-on: ${{ matrix.config.os }}
101+
runs-on: ubuntu-latest
131102
strategy:
132103
fail-fast: false
133104
matrix:
134105
config:
135-
- {
136-
name: "Ubuntu Latest GCC",
137-
artifact: "CalChart.tar.xz",
138-
os: ubuntu-latest
139-
}
140-
- {
141-
name: "macOS Latest Clang",
142-
artifact: "CalChart-3.6.2.dmg",
143-
os: ubuntu-latest
144-
}
145-
# CI for Windows doesn't seem functional. Need to investigate, (see https://github.com/calband/calchart/issues/363)
146-
- {
147-
name: "Windows Latest MSVC",
148-
artifact: "CalChart-3.6.2.exe",
149-
os: ubuntu-latest
150-
}
151-
needs: release
152-
106+
- artifact: "CalChart.tar.xz"
107+
- artifact: "CalChart-*.dmg"
108+
- artifact: "CalChart-*.exe"
109+
needs: build
153110
steps:
154-
- name: Download artifact
155-
uses: actions/download-artifact@v1
156-
with:
157-
name: ${{ matrix.config.artifact }}
158-
path: ./
159-
160-
- name: Download URL
161-
uses: actions/download-artifact@v1
162-
with:
163-
name: upload_url
164-
path: ./
165-
- id: set_upload_url
166-
run: |
167-
upload_url=`cat ./upload_url`
168-
echo ::set-output name=upload_url::$upload_url
169-
170-
- name: Upload to Release
171-
id: upload_to_release
172-
uses: actions/[email protected]
173-
env:
174-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
111+
# using https://github.com/ncipollo/release-action
112+
- name: release
113+
uses: ncipollo/release-action@v1
175114
with:
176-
upload_url: ${{ steps.set_upload_url.outputs.upload_url }}
177-
asset_path: ./${{ matrix.config.artifact }}
178-
asset_name: ${{ matrix.config.artifact }}
179-
asset_content_type: application/x-gtar
115+
artifacts: ${{github.workspace}}/build/${{ matrix.config.artifact }}
116+
bodyFile: "LATEST_RELEASE_NOTES.md"
117+
draft: true
118+
token: ${{ secrets.GITHUB_TOKEN }}
119+

.gitignore

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,9 @@
1-
build/*
2-
build-macos/CalChart.xcodeproj/project.xcworkspace/*
3-
build-macos/CalChart.xcodeproj/xcuserdata/*
4-
build-win/README.txt
1+
build*
52
contgram.output
63
contgram.tab.c
74
generated/*
8-
build-win/CalChart/Debug
9-
build-win/CalChart/Release
10-
build-win/CalChart/CalChart.v12.suo
11-
build-win/CalChart/CalChart.sdf
12-
build-win/CalChart/CalChart.opensdf
13-
build-win/CalChart/ipch
145
.DS_Store
156
*~
167
.vagrant
8+
.vscode
179
*.pyc

0 commit comments

Comments
 (0)