Skip to content

Commit

Permalink
Create a release github workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
jorchube committed Jan 2, 2021
1 parent dba0947 commit 357e9d5
Show file tree
Hide file tree
Showing 6 changed files with 67 additions and 13 deletions.
13 changes: 13 additions & 0 deletions .github/actions/create-artifact/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
inputs:
version:
description: "Version"
required: true

runs:
using: "composite"
steps:
- name: Generate artifact
run: ./generate-release-artifact.sh
shell: bash

- run: mv vest-release.tar.gz vest-release-${{inputs.version}}.tar.gz
6 changes: 6 additions & 0 deletions .github/actions/run-tests/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
runs:
using: "composite"
steps:
- name: Run tests
run: build/io.github.jorchube.vest.tests
shell: bash
14 changes: 1 addition & 13 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
@@ -1,33 +1,21 @@
# This is a basic workflow to help you get started with Actions

name: Tests

# Controls when the action will run.
on:
# Triggers the workflow on push or pull request events but only for the main branch
push:
pull_request:
branches: [ main ]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
unit-tests:
# The type of runner that the job will run on
runs-on: ubuntu-20.04

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2

- uses: ./.github/actions/prepare-host

- uses: ./.github/actions/build

# Runs a single command using the runners shell
- name: Run tests
run: build/io.github.jorchube.vest.tests
- uses: ./.github/actions/run-tests
42 changes: 42 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Release

on:
workflow_dispatch:
inputs:
major-number:
description: "Major version number"
required: true
minor-number:
description: "Minor version number"
required: true
revision-number:
description: "Revision version number"
required: true

jobs:
make-release:
runs-on: ubuntu-20.04

steps:
- uses: actions/checkout@v2

- uses: ./.github/actions/prepare-host

- uses: ./.github/actions/build

- uses: ./.github/actions/run-tests

- uses: ./.github/actions/create-artifact
with:
version: ${{major-number}}.${{minor-number}}.${{revision-number}}

- name: Create Release
uses: ncipollo/release-action@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
artifacts: "vest-release-*.tar.gz"
commit: main
tag: ${{major-number}}.${{minor-number}}.${{revision-number}}



2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
build
vest-release.tar.gz

!.github/actions/build
3 changes: 3 additions & 0 deletions generate-release-artifact.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash

tar cvzf vest-release.tar.gz build/io.github.jorchube.vest.h build/libio.github.jorchube.vest.a build/io.github.jorchube.vest.vapi templates

0 comments on commit 357e9d5

Please sign in to comment.