Skip to content

Commit 28d6a8e

Browse files
committed
Update CI
1 parent 8ddeaec commit 28d6a8e

File tree

1 file changed

+16
-85
lines changed

1 file changed

+16
-85
lines changed

.github/workflows/build.yml

Lines changed: 16 additions & 85 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,9 @@ jobs:
6363
cmake --build build
6464
6565
- name: Set up Python
66-
uses: actions/setup-python@v1
66+
uses: actions/setup-python@v4
6767
with:
68-
python-version: 3.7
68+
python-version: '3.10'
6969

7070
- name: Prepare Python
7171
run: |
@@ -82,95 +82,26 @@ jobs:
8282
export PATH="$PWD/../../build/Source:$PATH"; python -m unittest discover
8383
fi
8484
85-
- name: Save release
85+
- name: Tarball
8686
run: |
87-
mv ./build/Source/qi ./qi
87+
cd ${{github.workspace}}
88+
mv ./build/Source/qi ./
89+
ALL="qi"
8890
if [ "${{runner.os}}" == "macOS" ]; then
8991
echo "Using GNU tar"
90-
gtar -czf ${{matrix.config.artifact}} qi
92+
gtar -cvzf ${{matrix.config.artifact}} $ALL
9193
else
9294
echo "Using system tar"
93-
tar -czf ${{matrix.config.artifact}} qi
95+
tar -cvzf ${{matrix.config.artifact}} $ALL
9496
fi
9597
shell: bash
9698

97-
- name: Upload
98-
uses: actions/upload-artifact@v1
99+
- name: Release
100+
if: contains(github.ref, 'tags/v')
101+
uses: ncipollo/release-action@v1
99102
with:
100-
path: ./${{matrix.config.artifact}}
101-
name: ${{matrix.config.artifact}}
102-
103-
release:
104-
if: contains(github.ref, 'tags/v')
105-
runs-on: ubuntu-latest
106-
needs: build
107-
108-
steps:
109-
- name: Create Release
110-
id: create_release
111-
uses: actions/create-release@v1.0.0
112-
env:
113-
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
114-
with:
115-
tag_name: ${{github.ref}}
116-
release_name: Release ${{github.ref}}
117-
draft: true
118-
prerelease: false
119-
120-
- name: Store Release URL
121-
run: |
122-
echo "${{steps.create_release.outputs.upload_url}}" > ./upload_url
123-
124-
- uses: actions/upload-artifact@v1
125-
with:
126-
path: ./upload_url
127-
name: upload_url
128-
129-
publish:
130-
if: contains(github.ref, 'tags/v')
131-
name: ${{matrix.config.name}}
132-
runs-on: ${{matrix.config.os}}
133-
strategy:
134-
fail-fast: false
135-
matrix:
136-
config:
137-
- {
138-
name: "Ubuntu GCC", artifact: "qi-linux.tar.gz",
139-
os: ubuntu-16.04
140-
}
141-
- {
142-
name: "macOS", artifact: "qi-macos.tar.gz",
143-
os: macos-10.15
144-
}
145-
needs: release
146-
147-
steps:
148-
- name: Download Artifact
149-
uses: actions/download-artifact@v1
150-
with:
151-
name: ${{matrix.config.artifact}}
152-
path: ./
153-
154-
- name: Download URL
155-
uses: actions/download-artifact@v1
156-
with:
157-
name: upload_url
158-
path: ./
159-
160-
- name: Set Upload URL
161-
id: set_upload_url
162-
run: |
163-
URL=`cat ./upload_url`
164-
echo ${URL}
165-
echo "::set-output name=upload_url::${URL}"
166-
167-
- name: Upload to Release
168-
id: upload_to_release
169-
uses: actions/upload-release-asset@v1.0.1
170-
env:
171-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
172-
with:
173-
upload_url: ${{ steps.set_upload_url.outputs.upload_url }}
174-
asset_path: ./${{ matrix.config.artifact }}
175-
asset_name: ${{ matrix.config.artifact }}
176-
asset_content_type: application/gzip
103+
allowUpdates: true
104+
artifacts: ${{github.workspace}}/${{matrix.config.artifact}}
105+
artifactErrorsFailBuild: true
106+
draft: true
107+

0 commit comments

Comments
 (0)