Add steps to publish binaries when releases are tagged
This commit is contained in:
27
.github/workflows/ci.yml
vendored
27
.github/workflows/ci.yml
vendored
@@ -5,6 +5,8 @@ on:
|
|||||||
pull_request:
|
pull_request:
|
||||||
schedule:
|
schedule:
|
||||||
- cron: '0 0 * * 3' # At 12:00 AM, only on Wednesday
|
- cron: '0 0 * * 3' # At 12:00 AM, only on Wednesday
|
||||||
|
label:
|
||||||
|
types: [created, edited]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-test:
|
build-test:
|
||||||
@@ -53,12 +55,12 @@ jobs:
|
|||||||
if: "!matrix.extra"
|
if: "!matrix.extra"
|
||||||
run: cargo test --all --verbose
|
run: cargo test --all --verbose
|
||||||
|
|
||||||
# Extra steps
|
# Extra steps only run once to avoid duplication, when matrix.extra is true
|
||||||
- name: Test and report
|
- name: Test and report
|
||||||
if: matrix.extra
|
if: matrix.extra
|
||||||
run: |
|
run: |
|
||||||
cargo install cargo2junit --force
|
cargo install cargo2junit --force
|
||||||
cargo test --all -- -Z unstable-options --format json --report-time | cargo2junit > cargo_test_results.xml
|
RUSTC_BOOTSTRAP=1 cargo test --all -- -Z unstable-options --format json --report-time | cargo2junit > cargo_test_results.xml
|
||||||
- name: Publish cargo test results artifact
|
- name: Publish cargo test results artifact
|
||||||
if: matrix.extra
|
if: matrix.extra
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v3
|
||||||
@@ -99,6 +101,7 @@ jobs:
|
|||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-20.04
|
||||||
needs: [build-test]
|
needs: [build-test]
|
||||||
steps:
|
steps:
|
||||||
|
# Download prebuilt ubuntu binary from build-test job, setup logtalk
|
||||||
- uses: actions/download-artifact@v3
|
- uses: actions/download-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: scryer-prolog_ubuntu-20.04
|
name: scryer-prolog_ubuntu-20.04
|
||||||
@@ -139,3 +142,23 @@ jobs:
|
|||||||
files: '${{ env.LOGTALKUSER }}/tests/prolog/**/*.xml'
|
files: '${{ env.LOGTALKUSER }}/tests/prolog/**/*.xml'
|
||||||
fail_on: nothing
|
fail_on: nothing
|
||||||
comment_mode: off
|
comment_mode: off
|
||||||
|
|
||||||
|
# Publish binaries when building for a tag
|
||||||
|
release:
|
||||||
|
runs-on: ubuntu-20.04
|
||||||
|
needs: [build-test]
|
||||||
|
if: startsWith(github.ref, 'refs/tags/v')
|
||||||
|
steps:
|
||||||
|
- uses: actions/download-artifact@v3
|
||||||
|
- name: Zip binaries for release
|
||||||
|
run: |
|
||||||
|
zip scryer-prolog_macos-11.zip ./scryer-prolog_macos-11/scryer-prolog
|
||||||
|
zip scryer-prolog_ubuntu-20.04.zip ./scryer-prolog_ubuntu-20.04/scryer-prolog
|
||||||
|
zip scryer-prolog_windows-latest.zip ./scryer-prolog_windows-latest/scryer-prolog.exe
|
||||||
|
- name: Release
|
||||||
|
uses: softprops/action-gh-release@v1
|
||||||
|
with:
|
||||||
|
files: |
|
||||||
|
scryer-prolog_macos-11.zip
|
||||||
|
scryer-prolog_ubuntu-20.04.zip
|
||||||
|
scryer-prolog_windows-latest.zip
|
||||||
|
|||||||
Reference in New Issue
Block a user