-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
16 additions
and
85 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -63,9 +63,9 @@ jobs: | |
cmake --build build | ||
- name: Set up Python | ||
uses: actions/setup-python@v1 | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: 3.7 | ||
python-version: '3.10' | ||
|
||
- name: Prepare Python | ||
run: | | ||
|
@@ -82,95 +82,26 @@ jobs: | |
export PATH="$PWD/../../build/Source:$PATH"; python -m unittest discover | ||
fi | ||
- name: Save release | ||
- name: Tarball | ||
run: | | ||
mv ./build/Source/qi ./qi | ||
cd ${{github.workspace}} | ||
mv ./build/qi ./ | ||
ALL="qi" | ||
if [ "${{runner.os}}" == "macOS" ]; then | ||
echo "Using GNU tar" | ||
gtar -czf ${{matrix.config.artifact}} qi | ||
gtar -cvzf ${{matrix.config.artifact}} $ALL | ||
else | ||
echo "Using system tar" | ||
tar -czf ${{matrix.config.artifact}} qi | ||
tar -cvzf ${{matrix.config.artifact}} $ALL | ||
fi | ||
shell: bash | ||
|
||
- name: Upload | ||
uses: actions/upload-artifact@v1 | ||
- name: Release | ||
if: contains(github.ref, 'tags/v') | ||
uses: ncipollo/release-action@v1 | ||
with: | ||
path: ./${{matrix.config.artifact}} | ||
name: ${{matrix.config.artifact}} | ||
|
||
release: | ||
if: contains(github.ref, 'tags/v') | ||
runs-on: ubuntu-latest | ||
needs: build | ||
|
||
steps: | ||
- name: Create Release | ||
id: create_release | ||
uses: actions/[email protected] | ||
env: | ||
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} | ||
with: | ||
tag_name: ${{github.ref}} | ||
release_name: Release ${{github.ref}} | ||
draft: true | ||
prerelease: false | ||
|
||
- name: Store Release URL | ||
run: | | ||
echo "${{steps.create_release.outputs.upload_url}}" > ./upload_url | ||
- uses: actions/upload-artifact@v1 | ||
with: | ||
path: ./upload_url | ||
name: upload_url | ||
|
||
publish: | ||
if: contains(github.ref, 'tags/v') | ||
name: ${{matrix.config.name}} | ||
runs-on: ${{matrix.config.os}} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
config: | ||
- { | ||
name: "Ubuntu GCC", artifact: "qi-linux.tar.gz", | ||
os: ubuntu-16.04 | ||
} | ||
- { | ||
name: "macOS", artifact: "qi-macos.tar.gz", | ||
os: macos-10.15 | ||
} | ||
needs: release | ||
|
||
steps: | ||
- name: Download Artifact | ||
uses: actions/download-artifact@v1 | ||
with: | ||
name: ${{matrix.config.artifact}} | ||
path: ./ | ||
|
||
- name: Download URL | ||
uses: actions/download-artifact@v1 | ||
with: | ||
name: upload_url | ||
path: ./ | ||
|
||
- name: Set Upload URL | ||
id: set_upload_url | ||
run: | | ||
URL=`cat ./upload_url` | ||
echo ${URL} | ||
echo "::set-output name=upload_url::${URL}" | ||
- name: Upload to Release | ||
id: upload_to_release | ||
uses: actions/[email protected] | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ steps.set_upload_url.outputs.upload_url }} | ||
asset_path: ./${{ matrix.config.artifact }} | ||
asset_name: ${{ matrix.config.artifact }} | ||
asset_content_type: application/gzip | ||
allowUpdates: true | ||
artifacts: ${{github.workspace}}/${{matrix.config.artifact}} | ||
artifactErrorsFailBuild: true | ||
draft: true | ||
|