mirror of https://github.com/YosysHQ/yosys.git
CI: Check repo for YosysHQ specific jobs
Prevents unintended bumps on the flake.lock and Yosys version on forks (provided the forks synchronize their main after this gets merged). Update version.yml to use the same style of `if` on the job, rather than on specific actions. Wheels will still build as a cron job, but won't try to upload if it's a fork.
This commit is contained in:
parent
19667dd6f1
commit
6f7cd637cb
|
|
@ -6,6 +6,7 @@ on:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
lockfile:
|
lockfile:
|
||||||
|
if: github.repository == 'YosysHQ/Yosys'
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,7 @@ on:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
bump-version:
|
bump-version:
|
||||||
|
if: github.repository == 'YosysHQ/Yosys'
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
|
|
@ -18,11 +19,8 @@ jobs:
|
||||||
- name: Take last commit
|
- name: Take last commit
|
||||||
id: log
|
id: log
|
||||||
run: echo "message=$(git log --no-merges -1 --oneline)" >> $GITHUB_OUTPUT
|
run: echo "message=$(git log --no-merges -1 --oneline)" >> $GITHUB_OUTPUT
|
||||||
- name: Take repository
|
|
||||||
id: repo
|
|
||||||
run: echo "message=$GITHUB_REPOSITORY" >> $GITHUB_OUTPUT
|
|
||||||
- name: Bump version
|
- name: Bump version
|
||||||
if: "!contains(steps.log.outputs.message, 'Bump version') && contains(steps.repo.outputs.message, 'YosysHQ/yosys')"
|
if: ${{ !contains(steps.log.outputs.message, 'Bump version') }}
|
||||||
run: |
|
run: |
|
||||||
make bumpversion
|
make bumpversion
|
||||||
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
||||||
|
|
@ -30,7 +28,7 @@ jobs:
|
||||||
git add Makefile
|
git add Makefile
|
||||||
git commit -m "Bump version"
|
git commit -m "Bump version"
|
||||||
- name: Push changes # push the output folder to your repo
|
- name: Push changes # push the output folder to your repo
|
||||||
if: "!contains(steps.log.outputs.message, 'Bump version') && contains(steps.repo.outputs.message, 'YosysHQ/yosys')"
|
if: ${{ !contains(steps.log.outputs.message, 'Bump version') }}
|
||||||
uses: ad-m/github-push-action@master
|
uses: ad-m/github-push-action@master
|
||||||
with:
|
with:
|
||||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
|
||||||
|
|
@ -124,6 +124,7 @@ jobs:
|
||||||
path: ./wheelhouse/*.whl
|
path: ./wheelhouse/*.whl
|
||||||
upload_wheels:
|
upload_wheels:
|
||||||
name: Upload Wheels
|
name: Upload Wheels
|
||||||
|
if: github.repository == 'YosysHQ/Yosys'
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
# Specifying a GitHub environment is optional, but strongly encouraged
|
# Specifying a GitHub environment is optional, but strongly encouraged
|
||||||
environment: pypi
|
environment: pypi
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue