update tools #50
Workflow file for this run
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
name: Announce release | |
on: | |
push: | |
tags: | |
- '*-*-*' | |
jobs: | |
release: | |
name: Create Release | |
runs-on: ubuntu-latest | |
steps: | |
- run: | | |
TAG=${GITHUB_REF##*/} | |
echo TAG=${TAG} >> $GITHUB_ENV | |
echo IMAGE=colomoto/colomoto-docker:${TAG} >> $GITHUB_ENV | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-python@v2 | |
- name: release info | |
run: | | |
docker pull ${IMAGE} | |
docker run --rm ${IMAGE} apt list --installed > debian-installed-${TAG}.txt | |
docker run --rm ${IMAGE} conda list --explicit --md5 > conda-environment-${TAG}-explicit.yml | |
docker run --rm ${IMAGE} conda env export \ | |
-c potassco\ | |
-c conda-forge\ | |
-c colomoto\ | |
-c colomoto/label/fake\ | |
-c pauleve\ | |
-c daemontus\ | |
-c creda\ | |
-c bioconda\ | |
--from-history > conda-environment-${TAG}.yml | |
python hooks/release_changes.py > CHANGELOG.txt | |
- name: Release | |
uses: softprops/action-gh-release@v1 | |
with: | |
name: ${{ env.TAG }} | |
body_path: CHANGELOG.txt | |
files: | | |
debian-installed-${{ env.TAG }}.txt | |
conda-environment-${{ env.TAG }}-explicit.yml | |
conda-environment-${{ env.TAG }}.yml | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- uses: actions/checkout@v2 | |
with: | |
ref: history | |
clean: false | |
- name: update history | |
run: | | |
mkdir ${TAG} | |
mv debian-* conda-* ${TAG}/ | |
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
git config --local user.name "github-actions[bot]" | |
git add ${TAG} | |
git commit -m "environment for ${TAG} image" | |
git push | |
mybinder: | |
name: Update mybinder branch | |
runs-on: ubuntu-latest | |
steps: | |
- run: echo GITHUB_TAG=$(echo $GITHUB_REF|cut -d/ -f3) >> $GITHUB_ENV | |
- uses: actions/checkout@v2 | |
with: | |
ref: mybinder/latest | |
- run: | | |
sed -i "s/^\(FROM .*:\).*$/\\1$GITHUB_TAG/" Dockerfile | |
echo HAS_CHANGES=$(git diff --quiet Dockerfile || echo 1) >> $GITHUB_ENV | |
- name: update mybinder | |
if: env.HAS_CHANGES == 1 | |
run: | | |
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
git config --local user.name "github-actions[bot]" | |
git commit -a -m "follow release $GITHUB_TAG" | |
git tag mybinder/$GITHUB_TAG | |
git push --all |