Update github-actions-builddockerfile.yml
This commit is contained in:
@@ -10,37 +10,27 @@ on:
|
|||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
update_version:
|
|
||||||
|
docker:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
|
- name: Get next version
|
||||||
|
uses: reecetech/version-increment@2023.10.1
|
||||||
|
id: version
|
||||||
|
with:
|
||||||
|
scheme: calver
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
|
- name: Update version file
|
||||||
- name: Extract commit version and date
|
|
||||||
run: |
|
run: |
|
||||||
export COMMIT_VERSION=$(git describe --tags --abbrev=0)
|
sed -i 's/subgen_version =.*/subgen_version = ${{ steps.version.outputs.version }}/' subgen/subgen.py
|
||||||
export COMMIT_DATE=$(git log -1 --format=%cd --date=format:'%Y-%m-%d')
|
|
||||||
echo "Commit Version: $COMMIT_VERSION"
|
|
||||||
echo "Commit Date: $COMMIT_DATE"
|
|
||||||
echo "::set-env name=COMMIT_VERSION::$COMMIT_VERSION"
|
|
||||||
echo "::set-env name=COMMIT_DATE::$COMMIT_DATE"
|
|
||||||
|
|
||||||
- name: Update Python file
|
|
||||||
run: |
|
|
||||||
sed -i "s/\$COMMIT_VERSION/${COMMIT_VERSION}/g" subgen/subgen.py
|
|
||||||
sed -i "s/\$COMMIT_DATE/${COMMIT_DATE}/g" subgen/subgen.py
|
|
||||||
|
|
||||||
- name: Commit and push changes
|
- name: Commit and push changes
|
||||||
run: |
|
run: |
|
||||||
git config --global user.name "GitHub Actions"
|
git config --global user.name "GitHub Actions"
|
||||||
git config --global user.email "actions@github.com"
|
git config --global user.email "actions@github.com"
|
||||||
git add version.py
|
git add subgen/subgen.py
|
||||||
git commit -m "Update subgen.py with commit version and date"
|
git commit -m "Automated update subgen.py with version"
|
||||||
git push
|
git push
|
||||||
docker:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
-
|
-
|
||||||
name: Login to Docker Hub
|
name: Login to Docker Hub
|
||||||
uses: docker/login-action@v3.0.0
|
uses: docker/login-action@v3.0.0
|
||||||
|
|||||||
Reference in New Issue
Block a user