Skip to content

Commit

Permalink
ci(workflow): add release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
ccamel committed Feb 7, 2022
1 parent 48e6d04 commit e7fe83d
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 2 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
name: Build

on:
workflow_call:

push:
branches: [ main ]

Expand All @@ -19,7 +21,7 @@ jobs:
- name: Setup Go environment
uses: actions/[email protected]
with:
go-version: '1.17.6'
go-version: "1.17.6"

- name: Build go project
run: |
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
name: Lint

on:
workflow_call:

push:
branches: [ main ]

Expand Down
49 changes: 49 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Release

on:
workflow_dispatch:

jobs:
lint:
if: github.ref == 'refs/heads/main' && github.actor == 'bot-anik'
uses: ./.github/workflows/lint.yaml

build:
if: github.ref == 'refs/heads/main' && github.actor == 'bot-anik'
uses: ./.github/workflows/build.yaml

test:
if: github.ref == 'refs/heads/main' && github.actor == 'bot-anik'
uses: ./.github/workflows/test.yaml

perfom-release:
if: github.ref == 'refs/heads/main' && github.actor == 'bot-anik'
needs:
- lint
- build
- test
runs-on: ubuntu-20.04
steps:
- name: Check that main branch builds
uses: benc-uk/workflow-dispatch@v1
with:
workflow: Build
token: ${{ secrets.OKP4_TOKEN }}

- name: Check out repository
uses: actions/checkout@v2
with:
token: ${{ secrets.OKP4_TOKEN }}

- name: Release project
uses: cycjimmy/semantic-release-action@v2
with:
semantic_version: 19.0.2
branch: main
extra_plugins: |
@semantic-release/changelog
@semantic-release/exec
@semantic-release/git
@google/semantic-release-replace-plugin
env:
GITHUB_TOKEN: ${{ secrets.OKP4_TOKEN }}
4 changes: 3 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
name: Test

on:
workflow_call:

push:
branches: [ main ]

Expand All @@ -19,7 +21,7 @@ jobs:
- name: Setup Go environment
uses: actions/[email protected]
with:
go-version: '1.17.6'
go-version: "1.17.6"

- name: Test go project
run: |
Expand Down

0 comments on commit e7fe83d

Please sign in to comment.