Skip to content

Commit

Permalink
Separate the workflow to update the README
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastienfilion committed Sep 28, 2020
1 parent 4e1c126 commit 07b92fb
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 16 deletions.
19 changes: 3 additions & 16 deletions .github/workflows/publish-egg.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,10 @@
name: Publish
name: Publish Egg

on:
create:
release:
types: [published]

jobs:
update-readme:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: echo ::set-env name=RELEASE_VERSION::${GITHUB_REF#refs/tags/*}
- run: |
cat ./README.md | sed -e "s/https\:\/\/deno.land\/x\/functional\@[v0-9\.]*/https\:\/\/deno.land\/x\/functional\@${RELEASE_VERSION}/" | tee ./README.md
cat ./README.md | sed -e "s/https\:\/\/x.nest.land\/functional\@[v0-9\.]*/https\:\/\/x.nest.land\/functional\@${RELEASE_VERSION}/" | tee ./README.md
- run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git add .
git commit --amend --no-edit
git push https://${{ env.GITHUB_ACTOR }}:${{ secrets.GITHUB_TOKEN }}@github.com/sebastienfilion/functional.git HEAD:master --force
publish-egg:
runs-on: ubuntu-latest
steps:
Expand Down
24 changes: 24 additions & 0 deletions .github/workflows/update-readme.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Update Readme

on:
create:
tags:
- v*

jobs:
update-readme:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: echo ::set-env name=RELEASE_VERSION::${GITHUB_REF#refs/tags/*}
- run: >
cat ./README.md
| sed
-e "s/https\:\/\/deno.land\/x\/functional\@[v0-9\.]*/https\:\/\/deno.land\/x\/functional\@${RELEASE_VERSION}/"
-e "s/https\:\/\/x.nest.land\/functional\@[v0-9\.]*/https\:\/\/x.nest.land\/functional\@${RELEASE_VERSION}/"
| tee ./README.md
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git add .
git commit --amend --no-edit
git push https://${{ env.GITHUB_ACTOR }}:${{ secrets.GITHUB_TOKEN }}@github.com/sebastienfilion/functional.git HEAD:master --force

0 comments on commit 07b92fb

Please sign in to comment.