Skip to content

Commit

Permalink
Add release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
Jaime Piña committed Sep 6, 2020
1 parent 24b8f01 commit c2ff4ba
Show file tree
Hide file tree
Showing 2 changed files with 83 additions and 2 deletions.
79 changes: 79 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
name: Release

on:
push:
tags:
- '*'

jobs:
release_darwin:
name: Release Darwin
runs-on: macos-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Create tarball
run: |
make release/noti.darwinrelease
- name: Set tag env var
run: echo ::set-env name=GIT_TAG::${GITHUB_REF#refs/*/}
- name: Stash release
uses: actions/upload-artifact@v2
with:
name: noti.darwinrelease
path: release/noti.darwinrelease
release:
needs: release_darwin
name: Release
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Create release draft
id: create_release_draft
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
with:
tag_name: ${{github.ref}}
release_name: ${{github.ref}}
draft: true
prerelease: false
- name: Set tag env var
run: echo ::set-env name=GIT_TAG::${GITHUB_REF#refs/*/}
- name: Download Darwin release
uses: actions/download-artifact@v2
with:
name: noti.darwinrelease
path: release
- name: Create tarballs
run: |
make release
make release-darwin
- name: Upload Linux
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
with:
upload_url: ${{steps.create_release_draft.outputs.upload_url}}
asset_path: ./release/noti${{env.GIT_TAG}}.linux-amd64.tar.gz
asset_name: noti${{env.GIT_TAG}}.linux-amd64.tar.gz
asset_content_type: application/gzip; charset=binary
- name: Upload Darwin
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
with:
upload_url: ${{steps.create_release_draft.outputs.upload_url}}
asset_path: ./release/noti${{env.GIT_TAG}}.darwin-amd64.tar.gz
asset_name: noti${{env.GIT_TAG}}.darwin-amd64.tar.gz
asset_content_type: application/gzip; charset=binary
- name: Upload Windows
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
with:
upload_url: ${{steps.create_release_draft.outputs.upload_url}}
asset_path: ./release/noti${{env.GIT_TAG}}.windows-amd64.tar.gz
asset_name: noti${{env.GIT_TAG}}.windows-amd64.tar.gz
asset_content_type: application/gzip; charset=binary
6 changes: 4 additions & 2 deletions .github/workflows/go.yaml → .github/workflows/testing.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
name: Go
name: Testing

on:
- push
- pull_request

jobs:
build:
name: CI Job
Expand All @@ -11,7 +13,7 @@ jobs:
- macos-10.15
- ubuntu-18.04
- windows-2019
runs-on: ${{ matrix.os }}
runs-on: ${{matrix.os}}
steps:
- name: Setup Go
id: setup-go
Expand Down

0 comments on commit c2ff4ba

Please sign in to comment.