Skip to content

Commit

Permalink
Sync files with networkservicemesh/cmd-template
Browse files Browse the repository at this point in the history
This PR syncs files with https://github.com/networkservicemesh/cmd-template

Revision: https://github.com/networkservicemesh/cmd-template/commits/28ab652d217fe427326d012068a8faabe1668de5

commit 28ab652d217fe427326d012068a8faabe1668de5
Author: Nikita Skrynnik <93182827+NikitaSkrynnik@users.noreply.github.com>
Date:   Wed Feb 9 18:01:55 2022 +0700

    Add Release Action (#88)

    * check go.mod deps + create-release job

    Signed-off-by: Nikita Skrynnik <nikita.skrynnik@xored.com>

    * fix ci

    Signed-off-by: Nikita Skrynnik <nikita.skrynnik@xored.com>

    Co-authored-by: NSMBot <nsmbot@networkservicmesh.io>

Signed-off-by: NSMBot <nsmbot@networkservicmesh.io>
  • Loading branch information
NSMBot committed Feb 9, 2022
1 parent fbddbe6 commit 9f2d1d0
Showing 1 changed file with 57 additions and 1 deletion.
58 changes: 57 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,66 @@ on:
types:
- completed
workflows:
- 'ci'
- "ci"
jobs:
check-gomod-deps:
name: Check go.mod Dependencies
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' && contains(github.event.workflow_run.head_branch, 'release/') }}
steps:
- name: Get tag
run: |
branch=${{github.event.workflow_run.head_branch}}
echo '::set-output name=tag::'${branch#release/}
id: get-tag-step

- name: Check out code into the Go module directory
uses: actions/checkout@v2

- name: Check go.mod deps
run: |
cat go.mod |
grep 'github.com/networkservicemesh/.* v' |
grep -v 'github.com/networkservicemesh/.* ${{ steps.get-tag-step.outputs.tag }}' || exit 0;
exit 1;
create-release:
name: Create Release
runs-on: ubuntu-latest
needs: check-gomod-deps
if: ${{ github.event.workflow_run.conclusion == 'success' && contains(github.event.workflow_run.head_branch, 'release/') }}
steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
ref: refs/heads/${{github.event.workflow_run.head_branch}}

- name: Get tag
run: |
branch=${{github.event.workflow_run.head_branch}}
echo '::set-output name=tag::'${branch#release/}
id: get-tag-step

- name: Push tag ${{ steps.get-tag-step.outputs.tag }}
run: |
git status
git tag ${{ steps.get-tag-step.outputs.tag }}
git push origin ${{ steps.get-tag-step.outputs.tag }} -f
- name: Create release ${{ steps.get-tag-step.outputs.tag }}
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.NSM_BOT_GITHUB_TOKEN }}
with:
tag_name: refs/tags/${{ steps.get-tag-step.outputs.tag }}
release_name: ${{ steps.get-tag-step.outputs.tag }}
draft: false
prerelease: false

docker:
runs-on: ubuntu-latest
needs: check-gomod-deps
if: ${{ github.event.workflow_run.conclusion == 'success' && contains(github.event.workflow_run.head_branch, 'release/') }}
steps:
- name: Get tag
Expand Down

0 comments on commit 9f2d1d0

Please sign in to comment.