Skip to content

Commit

Permalink
ci: adds version number to docker file
Browse files Browse the repository at this point in the history
  • Loading branch information
jtyoung84 committed Feb 24, 2024
1 parent bbf6c07 commit df3a630
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 6 deletions.
40 changes: 34 additions & 6 deletions .github/workflows/tag_and_publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,42 @@ on:
paths:
- hortacloud-deployment/**
jobs:
tag:
uses: AllenNeuralDynamics/aind-github-actions/.github/workflows/tag.yml@main
secrets:
SERVICE_TOKEN: ${{ secrets.SERVICE_TOKEN }}

bump-version:
name: Bump version
runs-on: ubuntu-latest
outputs:
new_version: ${{ steps.output_version.outputs.new_version }}
steps:
- name: Checkout
uses: actions/checkout@v3
with:
ref: ${{ inputs.default_branch }}
fetch-depth: 0
token: ${{ secrets.SERVICE_TOKEN }}
- name: Get version file name set variables
run: |
docker_file="./hortacloud-deployment/Dockerfile"
first_line=$(head -n 1 $docker_file)
old_version=${first_line:3}
most_recent_commit=$(git log --oneline | head -1)
echo "VERSION_FILE=$docker_file" >> "$GITHUB_ENV"
echo "VERSION=${{ steps.tag_version.outputs.new_version }}" >> "$GITHUB_ENV"
- name: Update version file with new version
run: |
grep "__version__" "$VERSION_FILE"
sed -i --debug --expression="s|__version__.*|__version__ = \"${{ env.VERSION }}\"|" "$VERSION_FILE"
- name: Set output
id: output_version
run: echo "new_version=${{ env.VERSION }}" >> "$GITHUB_OUTPUT"
- name: Commit and Push version bump
uses: EndBug/add-and-commit@v9
with:
default_author: github_actions
message: "ci: version bump [skip actions]"
add: ${{ env.VERSION_FILE }}
publish:
runs-on: ubuntu-latest
needs: tag
needs: update_version
steps:
- uses: actions/checkout@v3
- name: Pull latest changes
Expand Down
1 change: 1 addition & 0 deletions hortacloud-deployment/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# v0.0.0
from node:16

RUN apt-get update && \
Expand Down

0 comments on commit df3a630

Please sign in to comment.