-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update workflow for automatically creating new data releases
- Loading branch information
Showing
1 changed file
with
37 additions
and
1 deletion.
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 |
---|---|---|
|
@@ -39,6 +39,9 @@ jobs: | |
- name: Get UniProt database version | ||
id: date | ||
run: echo "::set-output name=date::$(wget -O - https://www.uniprot.org/downloads 2> /dev/null | grep 'uniprot.releasedate' |sed 's/^.* .\([_0-9]*\).*$/\1/' | sed 's/_/./')" | ||
- name: Compute correct package version | ||
id: version_number | ||
run: echo "::set-output name=version_number::$(cat setup.py | sed -n '/version=/p' | sed 's/^.*version=.\(.*\).,$/\1/')" | ||
- name: Setup correct version numbering | ||
run: sed -i "s/version='\([^']*\)'/version='\1.${{ steps.date.outputs.date }}'/" setup.py | ||
- name: Generate packages for distribution | ||
|
@@ -48,4 +51,37 @@ jobs: | |
env: | ||
TWINE_USERNAME: ${{ secrets.TWINE_USERNAME }} | ||
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }} | ||
|
||
- name: Bump the current setup file (which contains the current version number) | ||
uses: test-room-7/action-update-file@v1 | ||
with: | ||
file-path: setup.py | ||
commit-msg: Bump package version to ${{ steps.date.outputs.date }} | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Get newly made commit sha | ||
id: commit_sha | ||
shell: bash | ||
run: | | ||
echo "::set-output name=sha::$(git rev-parse HEAD)" | ||
- name: Create new tag | ||
uses: octokit/[email protected] | ||
id: create_new_tag | ||
with: | ||
route: POST /repos/:owner/:repo/git/tags | ||
owner: mega-go | ||
repo: megago | ||
tag: v${{ steps.version_number.outputs.version_number }}.${{ steps.date.outputs.date }} | ||
message: "Automatic release v${{ steps.version_number.outputs.version_number }}.${{ steps.date.outputs.date }}" | ||
object: ${{ steps.commit_sha.outputs.sha }} | ||
type: commit | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Create Release | ||
id: create_release | ||
uses: actions/create-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
tag_name: v${{ steps.version_number.outputs.version_number }}.${{ steps.date.outputs.date }} | ||
release_name: Data release for UniProt at ${{ steps.date.outputs.date }} | ||
draft: false | ||
prerelease: false |