Skip to content

Commit

Permalink
Merge branch 'ci'
Browse files Browse the repository at this point in the history
  • Loading branch information
eras committed Jan 4, 2023
2 parents 52fc017 + f659bef commit 0ec50d5
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 40 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ jobs:
notify_end_failed:
runs-on: ubuntu-latest
needs: [notify_start, build]
if: ${{ !success() }}
if: ${{ failure() }}
steps:
- name: Build failed notification
uses: s3krit/[email protected]
Expand Down
72 changes: 33 additions & 39 deletions .github/workflows/tag.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -71,24 +71,12 @@ jobs:
run: 'cargo build --release --locked'
- run: strip target/release/mxrxtx
if: ${{ matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest' }}
- uses: actions/upload-artifact@v2
with:
name: mxrxtx
path: |
target/release/mxrxtx
Cargo.lock
- run: "gzip -9 < target/release/mxrxtx > mxrxtx.gz"
if: ${{ matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest' }}
# https://github.com/actions/upload-release-asset
- name: Upload Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/upload-artifact@v2
with:
# https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
upload_url: ${{ needs.start.outputs.upload_url }}
asset_path: ./target/release/mxrxtx
asset_name: mxrxtx-${{ needs.start.outputs.git_describe }}-${{ runner.os }}.bin
asset_content_type: application/octet-stream
path: mxrxtx.gz
name: mxrxtx-${{ runner.os }}.gz
if: ${{ matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest' }}
windows:
name: mxrxtx
Expand Down Expand Up @@ -122,26 +110,38 @@ jobs:
env:
GIT_DESCRIBE: ${{ needs.start.outputs.git_describe }}
run: 'cargo build --release'
- run: 'tar.exe -a -c -f mxrxtx.zip -C target/release mxrxtx.exe'
- uses: actions/upload-artifact@v2
with:
name: mxrxtx
path: |
target/release/mxrxtx.exe
Cargo.lock
# https://github.com/actions/upload-release-asset
- name: Upload Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
path: mxrxtx.zip
name: mxrxtx-${{ runner.os }}.zip
publish:
runs-on: ubuntu-latest
needs: [start, unix, windows]
if: ${{ success() }}
steps:
- uses: actions/checkout@v2
with:
# https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
upload_url: ${{ needs.start.outputs.upload_url }}
asset_path: ./target/release/mxrxtx.exe
asset_name: mxrxtx-${{ needs.start.outputs.git_describe }}-${{ runner.os }}.exe
asset_content_type: application/octet-stream
submodules: false
- uses: actions/download-artifact@v3
with:
path: .
- run: 'ls -la'
- name: Publish release
uses: eloquent/github-release-action@v3
with:
prerelease: false
# Note the "|" character: this is a multi-line string
assets: |
- path: mxrxtx-Windows.zip
name: mxrxtx-${{ needs.start.outputs.git_describe }}-Windows.zip
label: Windows binary
- path: mxrxtx-Linux.gz
name: mxrxtx-${{ needs.start.outputs.git_describe }}-Linux.gz
label: Linux binary
notify_end_success:
runs-on: ubuntu-latest
needs: [start, unix, windows]
needs: [start, publish]
if: ${{ success() }}
steps:
- name: Build succeeded notification
Expand All @@ -151,16 +151,10 @@ jobs:
access_token: ${{ secrets.MATRIX_ACCESS_TOKEN }}
message: "mxrxtx release ${{ needs.start.outputs.git_describe }} build complete. [Logs.](https://github.com/eras/mxrxtx/actions/runs/${{github.run_id}})"
server: ${{ secrets.MATRIX_SERVER }}
- name: Publish release
uses: eloquent/github-release-action@v3
with:
assets: |
- "mxrxtx-${{ needs.start.outputs.git_describe }}-Windows.exe": "mxrxtx-Windows.exe"
- "mxrxtx-${{ needs.start.outputs.git_describe }}-Linux.bin": "mxrxtx-Linux.bin"
notify_end_failed:
runs-on: ubuntu-latest
needs: [start, unix, windows]
if: ${{ !success() }}
needs: [start, publish]
if: ${{ failure() }}
steps:
- name: Build failed notification
uses: s3krit/[email protected]
Expand Down

0 comments on commit 0ec50d5

Please sign in to comment.