summaryrefslogtreecommitdiff
path: root/.github/workflows/release.yml
diff options
context:
space:
mode:
authorYuval Adam <_@yuv.al>2019-10-21 19:23:50 +0300
committerYuval Adam <_@yuv.al>2019-10-21 19:23:50 +0300
commit7ca288c04729fdf6d1286418861bd1de5d0d228f (patch)
treeb318327a1cefad131fbff8b76312ba36b2edf09c /.github/workflows/release.yml
parent8e9fe87a56db80747dd3f0ada6136fddeb8d7224 (diff)
Add everything and copy release
Diffstat (limited to '.github/workflows/release.yml')
-rw-r--r--.github/workflows/release.yml78
1 files changed, 56 insertions, 22 deletions
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index e493e75..72c9df3 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -1,39 +1,73 @@
-on:
- push:
- # Sequence of patterns matched against refs/tags
- tags:
- - 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
+name: Release
-name: Upload Release Asset
+on: [push]
jobs:
- build:
- name: Upload Release Asset
- runs-on: ubuntu-latest
+ release:
+ name: Release
+ runs-on: ${{ matrix.os }}
+ strategy:
+ matrix:
+ os: [macOS-latest, windows-latest, ubuntu-latest]
+ include:
+ - name: macOS-latest
+ archive: tar
+ output: streamlib-${{ github.ref }}-x86_64-apple-darwin.tar.gz
+ content_type: application/gzip
+ - name: windows-latest
+ archive: zip
+ output: streamlib-${{ github.ref }}-x86_64-pc-windows-msvc.zip
+ content_type: application/zip
+ - name: ubuntu-latest
+ archive: tar
+ output: streamlib-${{ github.ref }}-x86_64-unknown-linux-gnu.tar.gz
+ content_type: application/gzip
+
steps:
- - name: Checkout code
- uses: actions/checkout@master
- - name: Build project # This would actually build your project, using zip for an example artifact
+ - name: Checkout
+ uses: actions/checkout@v1
+
+ - name: Install toolchain
+ uses: actions-rs/toolchain@v1
+ with:
+ toolchain: stable
+
+ - name: Build
+ run: cargo build --verbose --release
+
+ - name: Test
+ run: cargo test --verbose
+
+ - name: Build ZIP
+ id: build_zip
+ if: matrix.archive == 'zip'
run: |
- zip --junk-paths my-artifact README
+ zip ${{ matrix.output }} target/release/streamlib.exe
+
+ - name: Build TAR
+ id: build_tar
+ if: matrix.archive == 'tar'
+ run: |
+ tar czvf ${{ matrix.output }} target/release/streamlib
+
- name: Create Release
id: create_release
- uses: actions/create-release@v1.0.0
+ uses: actions/create-release@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
- prerelease: false
+ prerelease: true # for now we only do pre-releases
+
- name: Upload Release Asset
- id: upload-release-asset
- uses: actions/upload-release-asset@v1.0.0
+ id: upload-release-asset
+ uses: actions/upload-release-asset@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
- upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
- asset_path: ./my-artifact.zip
- asset_name: my-artifact.zip
- asset_content_type: application/zip
-
+ upload_url: ${{ steps.create_release.outputs.upload_url }}
+ asset_path: ./${{ matrix.output }}
+ asset_name: ${{ matrix.output }}
+ asset_content_type: ${{ matrix.content_type }}