Skip to content

Commit

Permalink
Release packages on tagged
Browse files Browse the repository at this point in the history
  • Loading branch information
attakei committed Dec 3, 2021
1 parent 35ccff5 commit fcfbfff
Showing 1 changed file with 91 additions and 0 deletions.
91 changes: 91 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
name: Release packages

on:
push:
tags:
- 'v*.*.*'

jobs:
release:
runs-on: ubuntu-latest
outputs:
upload_url: ${{ steps.create_release.outputs.upload_url }}
steps:
- name: Create release on GitHub
id: create_release
uses: actions/create-release@latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref_name }}
release_name: ${{ github.ref_name }}
body: TBD
draft: false
prerelease: false
build:
needs: release
runs-on: ${{ matrix.vm }}
strategy:
matrix:
include:
- name: linux
vm: ubuntu-latest
- name: macosx
vm: macos-latest
- name: windows
vm: windows-latest
steps:
- uses: actions/checkout@v1
- name: Cache choosenim
id: cache_choosenim
uses: actions/cache@v1
with:
path: ~/.choosenim
key: choosenim-${{ matrix.vm }}
- name: Cache nimble
id: cache_nimble
uses: actions/cache@v1
with:
path: ~/.nimble
key: nimble-${{ matrix.vm }}
- uses: jiro4989/setup-nim-action@v1
with:
nim-version: 1.6.0
- name: Run main
run: |
nimble build -d:release -Y
nimble bundle
- name: Package(unix)
if: runner.os != 'Windows'
uses: thedoctor0/zip-release@master
with:
type: tar
directory: dist/
filename: ../gigi-${{ github.ref_name }}_${{ matrix.name }}.tar.gz
- name: Package(win)
if: runner.os == 'Windows'
uses: thedoctor0/zip-release@master
with:
type: zip
directory: dist/
filename: ../gigi-${{ github.ref_name }}_${{ matrix.name }}.zip
- name: Upload to release(unix)
if: runner.os != 'Windows'
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.release.outputs.upload_url }}
asset_path: gigi-${{ github.ref_name }}_${{ matrix.name }}.tar.gz
asset_name: gigi-${{ github.ref_name }}_${{ matrix.name }}.tar.gz
asset_content_type: application/gzip
- name: Upload to release(win)
if: runner.os == 'Windows'
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.release.outputs.upload_url }}
asset_path: gigi-${{ github.ref_name }}_${{ matrix.name }}.zip
asset_name: gigi-${{ github.ref_name }}_${{ matrix.name }}.zip
asset_content_type: application/zip

0 comments on commit fcfbfff

Please sign in to comment.