-
Notifications
You must be signed in to change notification settings - Fork 80
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This is now similar to the process used in rules_nixpkgs, releases are created from the master branch manually by triggering the `Prepare Release` workflow. This workflow creates a draft release which just needs to be published once it looks decent.
- Loading branch information
Showing
2 changed files
with
38 additions
and
29 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ name: Publish | |
|
||
on: | ||
release: | ||
types: [published] | ||
types: [released] | ||
workflow_dispatch: # allows manual triggering | ||
|
||
jobs: | ||
|
@@ -21,5 +21,32 @@ jobs: | |
git config user.email [email protected] | ||
- name: Merge master into release | ||
run: git merge --no-edit origin/master | ||
- name: Push | ||
run: git push | ||
- name: Fetch latest release artifact | ||
id: latest | ||
run: | | ||
gh release download -p '*.tar.gz' -D release | ||
ls release | sed -ne 's/rules_haskell-\(.*\)[.]tar[.]gz/version=\1/p' >> "${GITHUB_OUTPUT}" | ||
shasum -a 256 release/*.tar.gz | awk '{print "hash=" $1}' >> "${GITHUB_OUTPUT}" | ||
- name: Update hash in start script and docs | ||
run: | | ||
sed -ie '/bazel_dep(name = "rules_haskell"/s/version = "[^"]*"/version = "${{ steps.latest.outputs.version }}"/' start | ||
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 | ||
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 '}' \ | ||
docs/haskell-use-cases.rst | ||
- name: Commit and Push | ||
run: | | ||
git diff | ||
git add start docs/haskell-use-cases.rst | ||
git commit -m "Update rules_haskell in start script and docs to version ${{ steps.latest.outputs.version }}" | ||
git push |