summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.github/workflows/release.yml78
-rw-r--r--.gitignore2
-rw-r--r--Cargo.lock6
-rw-r--r--Cargo.toml9
-rw-r--r--src/main.rs3
5 files changed, 76 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 }}
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..53eaa21
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,2 @@
+/target
+**/*.rs.bk
diff --git a/Cargo.lock b/Cargo.lock
new file mode 100644
index 0000000..162027e
--- /dev/null
+++ b/Cargo.lock
@@ -0,0 +1,6 @@
+# This file is automatically @generated by Cargo.
+# It is not intended for manual editing.
+[[package]]
+name = "foo"
+version = "0.1.0"
+
diff --git a/Cargo.toml b/Cargo.toml
new file mode 100644
index 0000000..2cbf344
--- /dev/null
+++ b/Cargo.toml
@@ -0,0 +1,9 @@
+[package]
+name = "foo"
+version = "0.1.0"
+authors = ["Yuval Adam <_@yuv.al>"]
+edition = "2018"
+
+# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
+
+[dependencies]
diff --git a/src/main.rs b/src/main.rs
new file mode 100644
index 0000000..e7a11a9
--- /dev/null
+++ b/src/main.rs
@@ -0,0 +1,3 @@
+fn main() {
+ println!("Hello, world!");
+}