Skip to content

Commit

Permalink
ci: pin some deps and update ci
Browse files Browse the repository at this point in the history
  • Loading branch information
amitkparekh committed Dec 1, 2023
1 parent 34e1999 commit e7a3d57
Show file tree
Hide file tree
Showing 6 changed files with 210 additions and 154 deletions.
13 changes: 3 additions & 10 deletions .github/workflows/build-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ on:
workflow_dispatch:
release:
types: [published]
push:
branches:
- main

env:
PYTHON_VERSION: 3.9
Expand All @@ -28,15 +25,12 @@ jobs:
packages: write

steps:
- name: Define image tag
- name: Define image suffix
id: image-tag
env:
TORCH_VERSION_SUFFIX: ${{ matrix.torch_version_suffix }}
run: |
if [[ $TORCH_VERSION_SUFFIX == "" ]]; then
TORCH_VERSION_SUFFIX="cpu"
fi
IMAGE_TAG=$(echo "$TORCH_VERSION_SUFFIX" | tr -d '+')
IMAGE_TAG=$(echo "$TORCH_VERSION_SUFFIX" | tr + -)
echo "tag=$IMAGE_TAG" >> "$GITHUB_OUTPUT"
- name: Check out the repository
Expand All @@ -55,8 +49,7 @@ jobs:
with:
images: ${{ env.REGISTRY }}/${{ env.REPOSITORY }}
tags: |
type=raw,value=${{steps.image-tag.outputs.tag}},enable=${{ github.ref == format('refs/heads/{0}', 'main') }}
type=raw,value=${{steps.image-tag.outputs.tag}},enable={{is_default_branch}}
type=pep440,enable=true,priority=900,suffix=${{ steps.image-tag.outputs.tag }}
- name: Build and push image
uses: docker/build-push-action@v5
Expand Down
3 changes: 0 additions & 3 deletions .github/workflows/continuous_integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@ on:
workflow_call:
pull_request:
types: [opened, reopened, synchronize, ready_for_review]
branches:
- main
push:
branches: [main]

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

on:
push:
branches:
- main

env:
PYTHON_VERSION: 3.9

jobs:
labeler:
name: Update labels
runs-on: ubuntu-latest
steps:
- name: Check out the repository
uses: actions/checkout@v3

- name: Run Labeler
uses: crazy-max/ghaction-github-labeler@v4.1.0

continuous-integration:
name: Continuous Integration
uses: "./.github/workflows/continuous_integration.yml"
secrets: inherit

tests:
name: Tests
uses: "./.github/workflows/tests.yml"
secrets: inherit

release:
name: Release
runs-on: ubuntu-latest
needs: [continuous-integration, tests]
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
token: ${{ secrets.PAT }}

- name: Setup Git
env:
PAT: ${{ secrets.PAT }}
USERNAME: ${{ secrets.SIMBOT_BOT_USERNAME }}
EMAIL: ${{ secrets.SIMBOT_BOT_EMAIL }}
run: |
git config user.name "${USERNAME}"
git config user.email "${EMAIL}"
git config --global url."https://${PAT}@github.com/".insteadOf "https://github.com/"
- name: Install Poetry
run: pipx install poetry

- name: Set up Python ${{ env.PYTHON_VERSION }}
uses: actions/setup-python@v4
with:
python-version: ${{ env.PYTHON_VERSION }}
cache: "poetry"

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: "lts/*"
cache: "npm"

- name: Install semantic release
env:
GITHUB_TOKEN: ${{ secrets.PAT }}
run: |
npm install --no-save @bjoluc/semantic-release-config-poetry
npx semantic-release
3 changes: 0 additions & 3 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@ on:
pull_request:
branches: [main]
paths-ignore: ["**/*.md", "**/*.rst"]
push:
branches: [main]
paths-ignore: ["**/*.md", "**/*.rst"]

env:
PYTHON_VERSION: 3.9
Expand Down
Loading

0 comments on commit e7a3d57

Please sign in to comment.