mirror of https://github.com/VLSIDA/OpenRAM.git
Fix workflow skipping sync
This commit is contained in:
parent
e70f3b14f2
commit
ee1a29132f
|
|
@ -86,8 +86,8 @@ publicdev[(OpenRAM/dev)];
|
||||||
publicstable[(OpenRAM/stable)];
|
publicstable[(OpenRAM/stable)];
|
||||||
regressprivate{{regress}};
|
regressprivate{{regress}};
|
||||||
regresspublic{{regress}};
|
regresspublic{{regress}};
|
||||||
syncnover{{sync/no_version}};
|
syncnover{{sync}};
|
||||||
synctag{{sync/fix_tag}};
|
synctag{{sync_tag}};
|
||||||
deploy{{deploy}};
|
deploy{{deploy}};
|
||||||
versionprivate{{version}};
|
versionprivate{{version}};
|
||||||
versionpublic{{version}};
|
versionpublic{{version}};
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,5 @@
|
||||||
name: sync
|
name: sync
|
||||||
on:
|
on:
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- dev
|
|
||||||
workflow_call:
|
workflow_call:
|
||||||
secrets:
|
secrets:
|
||||||
WORKFLOW_ACCESS_TOKEN:
|
WORKFLOW_ACCESS_TOKEN:
|
||||||
|
|
@ -10,7 +7,7 @@ on:
|
||||||
jobs:
|
jobs:
|
||||||
# This job synchronizes the 'dev' branch of OpenRAM repo with the current branch
|
# This job synchronizes the 'dev' branch of OpenRAM repo with the current branch
|
||||||
sync_dev_no_version:
|
sync_dev_no_version:
|
||||||
if: ${{ github.event_name == 'workflow_call' && github.repository == 'VLSIDA/PrivateRAM' }}
|
if: ${{ github.repository == 'VLSIDA/PrivateRAM' }}
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
|
|
@ -28,39 +25,3 @@ jobs:
|
||||||
git pull public-repo dev
|
git pull public-repo dev
|
||||||
# Push the latest changes
|
# Push the latest changes
|
||||||
git push -u public-repo HEAD:dev
|
git push -u public-repo HEAD:dev
|
||||||
# This job makes sure that a version commit has a tag (manually bumped versions might have tags missing)
|
|
||||||
sync_dev_tag_check:
|
|
||||||
if: ${{ github.event_name == 'push' && github.repository == 'VLSIDA/PrivateRAM' && startsWith(github.event.head_commit.message, 'Bump version:') }}
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Checkout code
|
|
||||||
uses: actions/checkout@v2
|
|
||||||
with:
|
|
||||||
fetch-depth: 0
|
|
||||||
token: ${{ secrets.WORKFLOW_ACCESS_TOKEN }}
|
|
||||||
- name: Compare version and tag
|
|
||||||
run: |
|
|
||||||
# Configure pusher account
|
|
||||||
git config --global user.name "vlsida-bot"
|
|
||||||
git config --global user.email "mrg+vlsidabot@ucsc.edu"
|
|
||||||
# Add both repos
|
|
||||||
git remote add private-repo https://${{ secrets.WORKFLOW_ACCESS_TOKEN }}@github.com/VLSIDA/PrivateRAM.git
|
|
||||||
git remote add public-repo https://${{ secrets.WORKFLOW_ACCESS_TOKEN }}@github.com/VLSIDA/OpenRAM.git
|
|
||||||
# Read the version file
|
|
||||||
echo "LATEST_VERSION=v$(cat VERSION)" >> $GITHUB_ENV
|
|
||||||
# Read the tag name of the last commit
|
|
||||||
echo "HEAD_TAG=$(git describe --tags HEAD)" >> $GITHUB_ENV
|
|
||||||
- name: Make a new tag and push
|
|
||||||
if: ${{ env.LATEST_VERSION != env.HEAD_TAG }}
|
|
||||||
run: |
|
|
||||||
# Tag the commit
|
|
||||||
git tag ${{ env.LATEST_VERSION }} HEAD
|
|
||||||
# Push to private/dev
|
|
||||||
git pull private-repo dev
|
|
||||||
git push private-repo HEAD:dev ${{ env.LATEST_VERSION }}
|
|
||||||
# Push to public-repo/dev
|
|
||||||
git pull public-repo dev
|
|
||||||
git push public-repo HEAD:dev ${{ env.LATEST_VERSION }}
|
|
||||||
# Push to public/stable
|
|
||||||
git pull public-repo stable
|
|
||||||
git push public-repo HEAD:stable ${{ env.LATEST_VERSION }}
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,42 @@
|
||||||
|
name: sync_tag
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- dev
|
||||||
|
jobs:
|
||||||
|
# This job makes sure that a version commit has a tag (manually bumped versions might have tags missing)
|
||||||
|
sync_dev_tag_check:
|
||||||
|
if: ${{ github.repository == 'VLSIDA/PrivateRAM' && startsWith(github.event.head_commit.message, 'Bump version:') }}
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
token: ${{ secrets.WORKFLOW_ACCESS_TOKEN }}
|
||||||
|
- name: Compare version and tag
|
||||||
|
run: |
|
||||||
|
# Configure pusher account
|
||||||
|
git config --global user.name "vlsida-bot"
|
||||||
|
git config --global user.email "mrg+vlsidabot@ucsc.edu"
|
||||||
|
# Add both repos
|
||||||
|
git remote add private-repo https://${{ secrets.WORKFLOW_ACCESS_TOKEN }}@github.com/VLSIDA/PrivateRAM.git
|
||||||
|
git remote add public-repo https://${{ secrets.WORKFLOW_ACCESS_TOKEN }}@github.com/VLSIDA/OpenRAM.git
|
||||||
|
# Read the version file
|
||||||
|
echo "LATEST_VERSION=v$(cat VERSION)" >> $GITHUB_ENV
|
||||||
|
# Read the tag name of the last commit
|
||||||
|
echo "HEAD_TAG=$(git describe --tags HEAD)" >> $GITHUB_ENV
|
||||||
|
- name: Make a new tag and push
|
||||||
|
if: ${{ env.LATEST_VERSION != env.HEAD_TAG }}
|
||||||
|
run: |
|
||||||
|
# Tag the commit
|
||||||
|
git tag ${{ env.LATEST_VERSION }} HEAD
|
||||||
|
# Push to private/dev
|
||||||
|
git pull private-repo dev
|
||||||
|
git push private-repo HEAD:dev ${{ env.LATEST_VERSION }}
|
||||||
|
# Push to public-repo/dev
|
||||||
|
git pull public-repo dev
|
||||||
|
git push public-repo HEAD:dev ${{ env.LATEST_VERSION }}
|
||||||
|
# Push to public/stable
|
||||||
|
git pull public-repo stable
|
||||||
|
git push public-repo HEAD:stable ${{ env.LATEST_VERSION }}
|
||||||
Loading…
Reference in New Issue