Skip to content

Commit

Permalink
Simplify replacement of http_archive attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
avdv committed Sep 23, 2024
1 parent caaa2ae commit 5f64603
Showing 1 changed file with 4 additions and 13 deletions.
17 changes: 4 additions & 13 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,22 +34,13 @@ jobs:
sed -i \
-e '/bazel_dep(name = "rules_haskell"/s/version = "[^"]*"/version = "${{ steps.latest.outputs.version }}"/' \
start
# update http_archive attrs between `cat > WORKSPACE` and `EOF`
sed -i \
-e '/cat > WORKSPACE/,/^EOF/{' \
-e ' s%sha256 = "[^"]*"%sha256 = "${{ steps.latest.outputs.hash }}"%; ' \
-e ' s%strip_prefix = "[^"]*"%strip_prefix = "rules_haskell-${{ steps.latest.outputs.version }}"%; ' \
-e ' s%url = "[^"]*"%url = "/~https://github.com/tweag/rules_haskell/releases/download/v${{ steps.latest.outputs.version }}/rules_haskell-${{ steps.latest.outputs.version }}.tar.gz"%' \
-e '}' \
start
# update http_archive attrs in docs between `name = "rules_haskell"` and `url = "`
# update http_archive attrs between `name = "rules_haskell"` and `url = "`
sed -i \
-e '/name = "rules_haskell"/,/url = "/{' \
-e ' s%sha256 = "[^"]*"%sha256 = "${{ steps.latest.outputs.hash }}"%; ' \
-e ' s%strip_prefix = "[^"]*"%strip_prefix = "rules_haskell-${{ steps.latest.outputs.version }}"%; ' \
-e ' s%url = "[^"]*"%url = "/~https://github.com/tweag/rules_haskell/releases/download/v${{ steps.latest.outputs.version }}/rules_haskell-${{ steps.latest.outputs.version }}.tar.gz"%; ' \
-e ' s%x\{64\}%${{ steps.latest.outputs.hash }}%; ' \
-e ' s%M[.]NN%${{ steps.latest.outputs.version }}%g ' \
-e '}' \
docs/haskell-use-cases.rst
start docs/haskell-use-cases.rst
- name: Commit and Push
run: |
if ! git diff --exit-code ; then
Expand Down

0 comments on commit 5f64603

Please sign in to comment.