From 6a4a2e268dfa48a1d236760eabb27e07e5f5625a Mon Sep 17 00:00:00 2001 From: breakthewall Date: Sun, 10 Oct 2021 19:29:19 +0200 Subject: [PATCH] build(github): chain workflows --- .github/workflows/feedstock.yml | 52 ----------------------------- .github/workflows/tag.yml | 58 ++++++++++++++++++++++++++++++--- 2 files changed, 53 insertions(+), 57 deletions(-) delete mode 100644 .github/workflows/feedstock.yml diff --git a/.github/workflows/feedstock.yml b/.github/workflows/feedstock.yml deleted file mode 100644 index 9806b7c..0000000 --- a/.github/workflows/feedstock.yml +++ /dev/null @@ -1,52 +0,0 @@ -name: Update feedstock - -on: - release: - types: [published] - -jobs: - - feedstock: - runs-on: ubuntu-latest - steps: - - ## UPDATE CONDA-FORGE FEEDSTOCK - - name: Checkout feedstock fork - uses: actions/checkout@v2 - with: - repository: brsynth/brs_utils-feedstock - persist-credentials: false - fetch-depth: 0 - path: feedstock - - name: Update recipe - run: | - cd feedstock - wget -O- https://github.com/brsynth/brs-utils/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: joan.herisson@univ-evry.fr - VERSION: ${{ steps.tag_version.outputs.new_tag }} - - name: Push changes - uses: ad-m/github-push-action@master - with: - github_token: ${{ secrets.FEEDSTOCK }} - repository: brsynth/brs_utils-feedstock - directory: feedstock - - # ## PULL RESQUEST - # - name: Checkout - # uses: actions/checkout@v2 - # with: - # token: ${{ secrets.PAT }} - # repository: conda-forge/brs_utils-feedstock - # - name: Create Pull Request - # uses: peter-evans/create-pull-request@v3 - # with: - # token: ${{ secrets.FEEDSTOCK }} \ No newline at end of file diff --git a/.github/workflows/tag.yml b/.github/workflows/tag.yml index deafbe2..33d4d45 100644 --- a/.github/workflows/tag.yml +++ b/.github/workflows/tag.yml @@ -1,4 +1,4 @@ -name: Create Tag/Release +name: Tag/CHANGELOG/Feedstock on: push: @@ -9,11 +9,10 @@ on: jobs: - tag-changelog: + ## CREATE TAG/RELEASE + tag: runs-on: ubuntu-latest 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. @@ -34,7 +33,11 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - ## UPDATE CHANGELOG + ## UPDATE CHANGELOG + changelog: + needs: tag + runs-on: ubuntu-latest + steps: - uses: actions/checkout@v2 with: persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal access token. @@ -62,6 +65,51 @@ jobs: github_token: ${{ secrets.GITHUB_TOKEN }} branch: ${{ github.ref }} + ## UPDATE CONDA-FORGE FEEDSTOCK + feedstock: + needs: changelog + runs-on: ubuntu-latest + steps: + - name: Checkout feedstock fork + uses: actions/checkout@v2 + with: + repository: brsynth/brs_utils-feedstock + persist-credentials: false + fetch-depth: 0 + path: feedstock + - name: Update recipe + run: | + cd feedstock + wget -O- https://github.com/brsynth/brs-utils/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: joan.herisson@univ-evry.fr + VERSION: ${{ steps.tag_version.outputs.new_tag }} + - name: Push changes + uses: ad-m/github-push-action@master + with: + github_token: ${{ secrets.FEEDSTOCK }} + repository: brsynth/brs_utils-feedstock + directory: feedstock + + # ## PULL RESQUEST + # - name: Checkout + # uses: actions/checkout@v2 + # with: + # token: ${{ secrets.PAT }} + # repository: conda-forge/brs_utils-feedstock + # - name: Create Pull Request + # uses: peter-evans/create-pull-request@v3 + # with: + # token: ${{ secrets.FEEDSTOCK }} + # ## UPDATE CONDA-FORGE FEEDSTOCK # - name: Checkout feedstock fork # uses: actions/checkout@v2