Skip to content
This repository has been archived by the owner on Dec 16, 2022. It is now read-only.

Commit

Permalink
release workflow fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
epwalsh committed May 14, 2020
1 parent a6bd156 commit ef74f37
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 3 deletions.
19 changes: 19 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,25 @@ jobs:
run: |
make docker-test-run DOCKER_TAG=$DOCKER_TAG ARGS='test-pretrained'
gpu_checks:
name: GPU Checks
runs-on: [self-hosted, GPU]

steps:
- uses: actions/checkout@v2

- name: Set Docker tag
run: |
echo "::set-env name=DOCKER_TAG::${GITHUB_REF#refs/tags/}";
- name: Build test image
run: |
make docker-test-image DOCKER_TAG=$DOCKER_TAG
- name: Run GPU tests
run: |
make docker-test-run DOCKER_TAG=$DOCKER_TAG ARGS='gpu-test'
publish:
name: PyPI
needs: [build, test, docker, pretrained]
Expand Down
10 changes: 7 additions & 3 deletions scripts/get_version.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
#!/usr/bin/env python
#!/usr/bin/env python3

import argparse
from typing import Dict

import requests


def parse_args():
parser = argparse.ArgumentParser()
Expand All @@ -23,11 +21,17 @@ def get_current_version(minimal: bool = False) -> str:


def get_latest_version() -> str:
# Import this here so this requirements isn't mandatory when we just want to
# call `get_current_version`.
import requests

resp = requests.get("https://api.github.com/repos/allenai/allennlp-models/tags")
return resp.json()[0]["name"]


def get_stable_version() -> str:
import requests

resp = requests.get("https://api.github.com/repos/allenai/allennlp-models/releases/latest")
return resp.json()["tag_name"]

Expand Down

0 comments on commit ef74f37

Please sign in to comment.