Skip to content

Commit 5f64603

Browse files
committed
Simplify replacement of http_archive attributes
1 parent caaa2ae commit 5f64603

File tree

1 file changed

+4
-13
lines changed

1 file changed

+4
-13
lines changed

.github/workflows/publish.yaml

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -34,22 +34,13 @@ jobs:
3434
sed -i \
3535
-e '/bazel_dep(name = "rules_haskell"/s/version = "[^"]*"/version = "${{ steps.latest.outputs.version }}"/' \
3636
start
37-
# update http_archive attrs between `cat > WORKSPACE` and `EOF`
38-
sed -i \
39-
-e '/cat > WORKSPACE/,/^EOF/{' \
40-
-e ' s%sha256 = "[^"]*"%sha256 = "${{ steps.latest.outputs.hash }}"%; ' \
41-
-e ' s%strip_prefix = "[^"]*"%strip_prefix = "rules_haskell-${{ steps.latest.outputs.version }}"%; ' \
42-
-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"%' \
43-
-e '}' \
44-
start
45-
# update http_archive attrs in docs between `name = "rules_haskell"` and `url = "`
37+
# update http_archive attrs between `name = "rules_haskell"` and `url = "`
4638
sed -i \
4739
-e '/name = "rules_haskell"/,/url = "/{' \
48-
-e ' s%sha256 = "[^"]*"%sha256 = "${{ steps.latest.outputs.hash }}"%; ' \
49-
-e ' s%strip_prefix = "[^"]*"%strip_prefix = "rules_haskell-${{ steps.latest.outputs.version }}"%; ' \
50-
-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"%; ' \
40+
-e ' s%x\{64\}%${{ steps.latest.outputs.hash }}%; ' \
41+
-e ' s%M[.]NN%${{ steps.latest.outputs.version }}%g ' \
5142
-e '}' \
52-
docs/haskell-use-cases.rst
43+
start docs/haskell-use-cases.rst
5344
- name: Commit and Push
5445
run: |
5546
if ! git diff --exit-code ; then

0 commit comments

Comments
 (0)