Skip to content

Commit

Permalink
New release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
esamattis committed Dec 29, 2019
1 parent b39877e commit 11e5e67
Showing 1 changed file with 34 additions and 32 deletions.
66 changes: 34 additions & 32 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
on:
push:
tags:
- "v*"
branches:
- "release/v*"

name: Make Release

Expand All @@ -15,6 +15,11 @@ jobs:
steps:
- uses: actions/checkout@master

- name: Use Node.js
uses: actions/setup-node@v1
with:
node-version: 12

- name: Add x86_64-unknown-linux-musl target
uses: actions-rs/toolchain@v1
with:
Expand All @@ -23,36 +28,33 @@ jobs:
override: true

- name: Build with Cargo
uses: actions-rs/cargo@v1
with:
command: build
args: --release --target x86_64-unknown-linux-musl
run: |
env
cargo build --release --target x86_64-unknown-linux-musl
- name: Optimize binary size
run: strip ${{ env.binary_path }}

- name: Create Gitub Release
id: create_release
uses: actions/create-release@v1.0.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: ${{ github.ref }}
draft: false
prerelease: false

- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1.0.1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
# 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
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ${{ env.binary_path }}
asset_name: multip-amd64
asset_content_type: application/octet-stream
# - name: Create Gitub Release
# id: create_release
# uses: actions/create-release@v1.0.0
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# tag_name: ${{ github.ref }}
# release_name: ${{ github.ref }}
# draft: false
# prerelease: false
# - name: Upload Release Asset
# id: upload-release-asset
# uses: actions/upload-release-asset@v1.0.1
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# # 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
# upload_url: ${{ steps.create_release.outputs.upload_url }}
# asset_path: ${{ env.binary_path }}
# asset_name: multip-amd64
# asset_content_type: application/octet-stream

0 comments on commit 11e5e67

Please sign in to comment.