-
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.
- Loading branch information
1 parent
b94a030
commit 68c3541
Showing
25 changed files
with
293 additions
and
440 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 |
---|---|---|
|
@@ -2,44 +2,119 @@ name: Publish | |
|
||
on: | ||
push: | ||
tags: releases/[1-9]+.[0-9]+.[0-9]+ | ||
branches: [ stable ] | ||
branches: | ||
- stable | ||
paths: | ||
- '**.py' | ||
- '!tests/**' | ||
|
||
jobs: | ||
|
||
Publish: | ||
Conda-Build_Test: | ||
runs-on: ubuntu-latest | ||
|
||
env: | ||
ANACONDA_TOKEN: ${{secrets.ANACONDA_TOKEN}} | ||
ANACONDA_USER: ${{secrets.ANACONDA_USER}} | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: docker://continuumio/miniconda3 | ||
|
||
- name: Updating conda | ||
run: conda update --all -y | ||
|
||
- name: Installing make | ||
run: conda install -y make | ||
|
||
- name: Building package | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get -y install make | ||
- name: Build conda package | ||
run: | | ||
cd ci | ||
make conda-build | ||
- name: Testing package | ||
- name: Test conda package | ||
run: | | ||
cd ci | ||
make conda-test | ||
- name: Converting to other platforms | ||
run: | | ||
cd ci | ||
make conda-convert | ||
Tag: | ||
needs: [Conda-Build_Test] | ||
runs-on: ubuntu-latest | ||
outputs: # Create variable usable from another job | ||
new_tag: ${{ steps.tag_version.outputs.new_tag }} | ||
steps: | ||
## CREATE TAG/RELEASE | ||
- uses: actions/checkout@v2 | ||
with: | ||
persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal access token. | ||
fetch-depth: 0 # otherwise, there would be errors pushing refs to the destination repository. | ||
- name: Bump version and push tag | ||
id: tag_version | ||
uses: mathieudutour/[email protected] | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
release_branches: stable | ||
tag_prefix: | ||
- name: Create Release | ||
uses: actions/create-release@v1 | ||
with: | ||
tag_name: ${{ steps.tag_version.outputs.new_tag }} | ||
release_name: Release ${{ steps.tag_version.outputs.new_tag }} | ||
body: ${{ steps.tag_version.outputs.changelog }} | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
## UPDATE CHANGELOG | ||
- uses: actions/checkout@v2 | ||
with: | ||
persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal access token. | ||
fetch-depth: 0 # otherwise, there would be errors pushing refs to the destination repository. | ||
- uses: actions/setup-ruby@v1 | ||
# with: | ||
# ruby-version: '2.6' # Version range or exact version of a Ruby version to use, using semvers version range syntax. | ||
- name: Generate CHANGELOG | ||
env: | ||
CHANGELOG_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
gem install github_changelog_generator | ||
github_changelog_generator -u brsynth -p rxn_rebuild --no-unreleased | ||
- name: Update _version.py | ||
env: | ||
CHANGELOG_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
TAG: ${{ steps.tag_version.outputs.new_tag }} | ||
run: | | ||
folder=`dirname $(find . -name _version.py)` | ||
echo "__version__ = \"$TAG\"" > $folder/_version.py | ||
- name: Commit files | ||
run: | | ||
git config --local user.email "$GITHUB_EMAIL" | ||
git config --local user.name "$GITHUB_USERNAME" | ||
git commit -m "doc(CHANGELOG): update" -a | ||
env: | ||
GITHUB_USERNAME: brsynth | ||
GITHUB_EMAIL: [email protected] | ||
- name: Push changes | ||
uses: ad-m/github-push-action@master | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
branch: ${{ github.ref }} | ||
|
||
- name: Uploading to anaconda | ||
run: | | ||
cd ci | ||
make conda-publish | ||
## UPDATE CONDA-FORGE FEEDSTOCK | ||
Feedstock: | ||
needs: [Tag] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout feedstock fork | ||
uses: actions/checkout@v2 | ||
with: | ||
repository: conda-forge/rxn_rebuild-feedstock | ||
persist-credentials: false | ||
fetch-depth: 0 | ||
- name: Update recipe | ||
run: | | ||
wget -O- https://github.com/brsynth/rxn_rebuild/archive/refs/tags/$VERSION.tar.gz | shasum -a 256 > sha.txt | ||
sha=`python -c "f = open('sha.txt'); print(f.read().split()[0]); f.close()"` | ||
rm -f sha.txt | ||
sed -i -E "s/(\{% set version = \")[^>]+(\" %\})/\1$VERSION\2/" recipe/meta.yaml | ||
sed -i -E "s/(sha256: )[^>]+/\1$sha/" recipe/meta.yaml | ||
git config --local user.email "$GITHUB_EMAIL" | ||
git config --local user.name "$GITHUB_USERNAME" | ||
git commit -m "chore(meta.yml): update version" -a | ||
env: | ||
GITHUB_USERNAME: brsynth | ||
GITHUB_EMAIL: [email protected] | ||
VERSION: ${{ needs.tag.outputs.new_tag }} | ||
- name: Create Pull Request | ||
uses: peter-evans/create-pull-request@v3 | ||
with: | ||
token: ${{ secrets.FEEDSTOCK }} | ||
push-to-fork: brsynth/rxn_rebuild-feedstock |
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,3 @@ | ||
# Changelog | ||
|
||
## [2.1.0] |
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 +0,0 @@ | ||
recursive-include rxn_rebuild/workflows * | ||
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
File renamed without changes.
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.