-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add action for release #1
Merged
Merged
Changes from 6 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
98333c3
Add action yaml
chrisjiayoulin 14e0763
Refactor action workflow
chrisjiayoulin 7daa7f2
Remove release after deploy fail
chrisjiayoulin 4eaed92
Add github issue template
chrisjiayoulin 9888edc
Rollback version to 0.9.0
chrisjiayoulin b8e3c07
Update setup.py classifiers
chrisjiayoulin 88ebd28
Update Action according to discussion
chrisjiayoulin 40ae140
Fix Action error
chrisjiayoulin 2b7220e
Fix Action input.Password description
chrisjiayoulin File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
name: Bug | ||
description: Let us know about an unexpected error, a crash, or an incorrect behavior. | ||
labels: | ||
- 'bug' | ||
body: | ||
- type: textarea | ||
id: problem | ||
attributes: | ||
label: Problem | ||
validations: | ||
required: true | ||
|
||
|
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 @@ | ||
blank_issues_enabled: false |
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,18 @@ | ||
name: Feature | ||
description: Suggest a new feature. | ||
labels: | ||
- 'enhancement' | ||
body: | ||
- type: textarea | ||
id: use-cases | ||
attributes: | ||
label: Use Cases | ||
validations: | ||
required: true | ||
|
||
- type: textarea | ||
id: attempted-solutions | ||
attributes: | ||
label: Attempted Solutions | ||
validations: | ||
required: false |
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,137 @@ | ||
name: seqslab connector release | ||
on: | ||
workflow_dispatch: | ||
inputs: | ||
User: | ||
description: 'Pypi User' | ||
required: true | ||
default: '__token__' | ||
Password: | ||
description: 'Pypi Password' | ||
required: true | ||
default: '' | ||
|
||
jobs: | ||
test-tags: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@master | ||
- name: Setup Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: 3.8 | ||
|
||
- name: Get versioning information | ||
id: versions | ||
run: | | ||
CURRENT_TAG=${GITHUB_REF#refs/tags/} | ||
CURRENT_VERSION=$(cat seqslab/__init__.py | grep "__version__"| awk '{print $3}' | sed 's/^"//'| sed 's/"$//' ) | ||
|
||
# set output | ||
echo "CURRENT_VERSION=$CURRENT_VERSION" >> $GITHUB_OUTPUT | ||
|
||
- name: Print versioning information | ||
run: | | ||
echo "Print CURRENT_VERSION" | ||
echo ${{ steps.versions.outputs.CURRENT_VERSION }} | ||
|
||
- uses: mukunku/tag-exists-action@v1.2.0 | ||
id: checkTag | ||
with: | ||
tag: "${{ steps.versions.outputs.CURRENT_VERSION }}" | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Verify tag is documented | ||
run: | | ||
if ${{ steps.checkTag.outputs.exists }}; then | ||
echo "========================================================================" | ||
echo "Error: ${{ steps.versions.outputs.CURRENT_VERSION }} exists"; | ||
echo "========================================================================" | ||
exit 1; | ||
else | ||
echo "${{ steps.versions.outputs.CURRENT_VERSION }} does not exist" | ||
fi | ||
|
||
|
||
deploy: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@master | ||
- name: Setup Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: 3.8 | ||
|
||
- name: Get Current Timestamp | ||
if: success() | ||
id: date | ||
run: echo "NOW=$(date +'%Y-%m-%d-%H-%M')">> $GITHUB_OUTPUT | ||
|
||
- name: Get versioning information | ||
id: versions | ||
run: | | ||
CURRENT_TAG=${GITHUB_REF#refs/tags/} | ||
CURRENT_VERSION=$(cat seqslab/__init__.py | grep "__version__"| awk '{print $3}' | sed 's/^"//'| sed 's/"$//' ) | ||
|
||
# set output | ||
echo "CURRENT_VERSION=$CURRENT_VERSION" >> $GITHUB_OUTPUT | ||
|
||
- name: Print versioning information | ||
run: | | ||
# set output | ||
echo "Print Datetime" | ||
echo ${{ steps.date.outputs.NOW }} | ||
echo "Print CURRENT_VERSION" | ||
echo ${{ steps.versions.outputs.CURRENT_VERSION }} | ||
|
||
# Publish Release | ||
- name: Create Seqslab Connector Release | ||
if: (github.ref == 'refs/heads/main') && success() | ||
id: create_release | ||
uses: actions/create-release@v1 | ||
with: | ||
tag_name: ${{ steps.versions.outputs.CURRENT_VERSION }} | ||
release_name: ${{ steps.versions.outputs.CURRENT_VERSION }} | ||
body: | | ||
TimeStamp | ||
- timestamp = ${{ steps.date.outputs.NOW }} | ||
draft: false | ||
prerelease: false | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token | ||
|
||
- name: Install Python dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install wheel twine | ||
|
||
- name: Build dist | ||
run: python setup.py sdist bdist_wheel --python-tag py3 | ||
|
||
- name: Archive dist | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: dist | ||
path: | | ||
dist/*.tar.gz | ||
dist/*.whl | ||
|
||
- name: Verify long description rendering | ||
run: twine check dist/* | ||
|
||
- name: Publish distribution 📦 to PyPI | ||
id: deploy | ||
env: | ||
PYPI_API_USER: ${{ github.event.inputs.User }} | ||
PYPI_API_TOKEN: ${{ github.event.inputs.Password }} | ||
run: | | ||
twine upload --non-interactive -u "${PYPI_API_USER}" -p "${PYPI_API_TOKEN}" dist/* | ||
|
||
# delete release if deploy fail | ||
- uses: dev-drprasad/delete-tag-and-release@v1.0 # PRERELEASE is v1.0 and can also be used to test and give us feedback | ||
if: steps.deploy.outputs.exit_code != 0 | ||
with: | ||
tag_name: ${{ steps.versions.outputs.CURRENT_VERSION }} #(required) tag name to delete | ||
github_token: ${{ secrets.GITHUB_TOKEN }} # (required) a GitHub token with write access to the repo that needs to be modified | ||
delete_release: true |
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 @@ | ||
[bdist_wheel] | ||
universal = 1 | ||
[flake8] | ||
max-line-length = 119 | ||
# Ignore some well known paths | ||
exclude = .venv,.tox,dist,doc,build,*.egg,db/env.py,db/versions/*.py,site | ||
[metadata] | ||
license_file = LICENSE | ||
project_urls = | ||
Documentation = https://docs.atgenomix.com/ | ||
Repository = https://github.com/atgenomix/seqslab-connector |
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.