forked from mxcube/mxcubeweb
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
There is now a configuration file for `yamllint` and a `pre-commit` hook. The most straightforward linting issues were fixed. The other ones are ignored and should be handled in the future.
- Loading branch information
1 parent
48d5f74
commit ead0619
Showing
15 changed files
with
186 additions
and
128 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,94 +1,100 @@ | ||
--- | ||
|
||
# yamllint disable rule:line-length | ||
|
||
name: Create/Update Tag | ||
on: | ||
|
||
on: # yamllint disable-line rule:truthy | ||
push: | ||
branches: | ||
- develop | ||
|
||
jobs: | ||
create-version-tag: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
token: ${{ secrets.CI_TOKEN }} | ||
- name: Set up Python 3.10 | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.10" | ||
- name: Update version | ||
id: update-version | ||
run: | | ||
- uses: actions/checkout@v3 | ||
with: | ||
token: ${{ secrets.CI_TOKEN }} | ||
- name: Set up Python 3.10 | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.10" | ||
- name: Update version | ||
id: update-version | ||
run: | | ||
pip install --upgrade pip | ||
pip install poetry | ||
poetry version minor | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "Marcus Oskarsson" | ||
git add -A | ||
git commit -m "[skip ci] Bumped minor version" | ||
git push -f | ||
poetry build | ||
- name: Publish package to PyPI | ||
id: publish-pacakge | ||
run: | | ||
poetry config pypi-token.pypi ${{ secrets.PYPI }} | ||
poetry publish | ||
- name: Read package version | ||
id: set-tag | ||
run: | | ||
pip install --upgrade pip | ||
pip install poetry | ||
poetry version minor | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "Marcus Oskarsson" | ||
git add -A | ||
git commit -m "[skip ci] Bumped minor version" | ||
git push -f | ||
poetry build | ||
- name: Publish package to PyPI | ||
id: publish-pacakge | ||
run: | | ||
poetry config pypi-token.pypi ${{ secrets.PYPI }} | ||
poetry publish | ||
- name: Read package version | ||
id: set-tag | ||
run: | | ||
pip install --upgrade pip | ||
pip install toml | ||
echo ::set-output name=tag_name::v$(python -c 'import toml; print(toml.load("./pyproject.toml")["tool"]["poetry"]["version"])') | ||
- name: Check tag exists | ||
id: check-tag-exists | ||
uses: actions/github-script@v6 | ||
env: | ||
TAG: ${{ steps.set-tag.outputs.tag_name }} | ||
with: | ||
github-token: ${{ github.token }} | ||
script: | | ||
// https://github.com/mukunku/tag-exists-action | ||
var exists = 'false'; | ||
try { | ||
const getRefResponse = await github.rest.git.getRef({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
ref: "refs/tags/${{ steps.set-tag.outputs.tag_name }}" | ||
}); | ||
pip install toml | ||
echo ::set-output name=tag_name::v$(python -c 'import toml; print(toml.load("./pyproject.toml")["tool"]["poetry"]["version"])') | ||
- name: Check tag exists | ||
id: check-tag-exists | ||
uses: actions/github-script@v6 | ||
env: | ||
TAG: ${{ steps.set-tag.outputs.tag_name }} | ||
with: | ||
github-token: ${{ github.token }} | ||
script: | | ||
// https://github.com/mukunku/tag-exists-action | ||
var exists = 'false'; | ||
try { | ||
const getRefResponse = await github.rest.git.getRef({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
ref: "refs/tags/${{ steps.set-tag.outputs.tag_name }}" | ||
}); | ||
if (getRefResponse.status === 200) { | ||
console.log("Tag was found"); | ||
exists = 'true'; | ||
} | ||
} catch(error) { | ||
console.log("Tag was not found"); | ||
} | ||
core.setOutput('exists', exists); | ||
if (getRefResponse.status === 200) { | ||
console.log("Tag was found"); | ||
exists = 'true'; | ||
} | ||
} catch(error) { | ||
console.log("Tag was not found"); | ||
} | ||
core.setOutput('exists', exists); | ||
- name: Update tag | ||
uses: actions/github-script@v6 | ||
if: steps.check-tag-exists.outputs.exists == 'true' | ||
env: | ||
TAG: ${{ steps.set-tag.outputs.tag_name }} | ||
with: | ||
github-token: ${{ github.token }} | ||
script: | | ||
github.rest.git.updateRef({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
ref: "refs/tags/${{ steps.set-tag.outputs.tag_name }}", | ||
sha: context.sha | ||
}) | ||
- name: Update tag | ||
uses: actions/github-script@v6 | ||
if: steps.check-tag-exists.outputs.exists == 'true' | ||
env: | ||
TAG: ${{ steps.set-tag.outputs.tag_name }} | ||
with: | ||
github-token: ${{ github.token }} | ||
script: | | ||
github.rest.git.updateRef({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
ref: "refs/tags/${{ steps.set-tag.outputs.tag_name }}", | ||
sha: context.sha | ||
}) | ||
- name: Create tag | ||
uses: actions/github-script@v6 | ||
if: steps.check-tag-exists.outputs.exists != 'true' | ||
env: | ||
TAG: ${{ steps.set-tag.outputs.tag_name }} | ||
with: | ||
github-token: ${{ github.token }} | ||
script: | | ||
github.rest.git.createRef({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
ref: "refs/tags/${{ steps.set-tag.outputs.tag_name }}", | ||
sha: context.sha | ||
}) | ||
- name: Create tag | ||
uses: actions/github-script@v6 | ||
if: steps.check-tag-exists.outputs.exists != 'true' | ||
env: | ||
TAG: ${{ steps.set-tag.outputs.tag_name }} | ||
with: | ||
github-token: ${{ github.token }} | ||
script: | | ||
github.rest.git.createRef({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
ref: "refs/tags/${{ steps.set-tag.outputs.tag_name }}", | ||
sha: context.sha | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- | ||
|
||
extends: default | ||
|
||
ignore: | | ||
ui/pnpm-lock.yaml | ||
rules: | ||
# Match line length to the one set by `black` the Python formatter | ||
line-length: | ||
max: 88 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
--- | ||
|
||
name: mxcubeweb | ||
|
||
channels: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.