Skip to content

Commit

Permalink
Update workflow.
Browse files Browse the repository at this point in the history
Signed-off-by: BugDiver <vinaysh@thoughtworks.com>
  • Loading branch information
BugDiver committed Jun 3, 2020
1 parent 55045ce commit 06baa29
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 32 deletions.
23 changes: 0 additions & 23 deletions .github/workflows/build.yml

This file was deleted.

19 changes: 10 additions & 9 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,30 @@
name: deploy
on: [deployment]
on:
pull_request:
types:
- closed

jobs:
deploy:
name: deploy flash
runs-on: macos-latest
if: github.event_name == 'pull_request' && github.event.action == 'closed' && github.event.pull_request.merged == true && !contains(github.event.pull_request.labels.*.name, 'SkipRelease')
name: Deploy flash
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'

steps:
- uses: actions/checkout@v1

- uses: actions/checkout@v2
- name: Setup go 1.13.1
uses: actions/setup-go@v1
with:
go-version: 1.13.1

- uses: geertvdc/setup-hub@master

- name: build
run: |
go run build/make.go --all-platforms
go run build/make.go --all-platforms --distro
- name: Install hub
run: brew install hub
- name: update
run: |
cd deploy
Expand Down Expand Up @@ -56,11 +59,9 @@ jobs:
with:
state: 'success'
token: '${{ secrets.GITHUB_TOKEN }}'

- name: 'deployment failure'
if: failure()
uses: 'deliverybot/status@master'
with:
state: 'failure'
token: '${{ secrets.GITHUB_TOKEN }}'

52 changes: 52 additions & 0 deletions .github/workflows/version.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Version Check
on:
pull_request:
types:
- synchronize

jobs:
check:
name: check if version is bumped
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: '3.x'

- name: Verify version is bumped or not
id: version_check
env:
tags_url: ${{ toJson(github.event.pull_request.base.repo.tags_url) }}
run: |
import json
import os
from distutils.version import StrictVersion
from urllib import request
file_name = "plugin.json"
repo_name = os.environ["GITHUB_REPOSITORY"]
res = request.urlopen("https://api.github.com/repos/{}/tags".format(repo_name))
data = res.read().decode("utf-8")
tags = json.loads(data)
latest_release_version = StrictVersion(tags[0]["name"].replace('v', ''))
with open(file_name, 'r') as f:
data = json.load(f)
current_version = StrictVersion(data["version"])
print("::set-output name=is_version_bumped::{0}".format(current_version > latest_release_version))
shell: python
- name: foo
if: steps.version_check.outputs.is_version_bumped == 'True'
run: |
echo "GOTCHAAAAA"
# - uses: christianvuerings/add-labels@v1
# if: steps.version_check.outputs.is_version_bumped == 'True'
# with:
# labels: |
# minor release
# bug

0 comments on commit 06baa29

Please sign in to comment.