From 14d0027b749b35841400634aac477681cb078827 Mon Sep 17 00:00:00 2001 From: Claudio Bley Date: Mon, 9 Sep 2024 11:22:51 +0200 Subject: [PATCH 01/12] Create draft release via GitHub CLI or UI --- .github/workflows/prepare-release.yaml | 67 +++++++++++++++----------- .github/workflows/release_prep.sh | 40 +++++++++++++++ 2 files changed, 79 insertions(+), 28 deletions(-) create mode 100755 .github/workflows/release_prep.sh diff --git a/.github/workflows/prepare-release.yaml b/.github/workflows/prepare-release.yaml index fd68c7dcd..6401c5c54 100644 --- a/.github/workflows/prepare-release.yaml +++ b/.github/workflows/prepare-release.yaml @@ -1,38 +1,49 @@ -name: Prepare release +# Create a draft release when triggered via Github's UI or Github CLI +name: Prepare Release on: - push: - tags: - - "v[0-9]*.[0-9]*" + workflow_dispatch: + inputs: + version: + description: 'Version to release (e.g. 0.11.0)' + required: true + type: string + +permissions: + contents: write jobs: - update-release-notes: - name: Update release + release: + name: Prepare Release runs-on: ubuntu-latest steps: + - name: Check version + run: | + if ! [[ '${{ inputs.version }}' =~ ^[0-9]+[.][0-9]+([.][0-9]+)?$ ]]; then + echo '${{ inputs.version }} does not match expected format `major.minor.patch?`' >&2 + exit 1 + fi - name: Checkout uses: actions/checkout@v4 - - name: Create archive - id: archive + with: + ref: master # only create releases from main branch + - name: Read section from CHANGELOG.md + id: extract-changelog + uses: sean0x42/markdown-extract@v2 + with: + file: CHANGELOG.md + pattern: ${{ inputs.version }} + - name: Prepare release notes and artifacts run: | - TAG="${GITHUB_REF_NAME}" - REPOSITORY_NAME="${GITHUB_REPOSITORY#*/}" - PREFIX="${REPOSITORY_NAME}-${TAG:1}" - ARCHIVE="${PREFIX}.tar.gz" - - echo "tgz=${ARCHIVE}" >> $GITHUB_OUTPUT - - git archive --format=tar.gz --prefix="${PREFIX}/" -o "$ARCHIVE" "${TAG}" - - name: Prepare bzlmod / WORKSPACE snippets - run: .github/workflows/prepare_snippets.sh ${{ steps.archive.outputs.tgz }} > release_notes.txt - - name: Generate changelog + .github/workflows/release_prep.sh v${{ inputs.version }} > release_notes.txt + printf '${{ steps.extract-changelog.outputs.markdown }}' >> release_notes.txt + - name: Create draft release + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | - printf '\n-----\n\n' >> release_notes.txt - awk -f .github/workflows/changelog.awk CHANGELOG.md >> release_notes.txt - - name: Release - uses: softprops/action-gh-release@v2 - with: - draft: true - body_path: release_notes.txt - fail_on_unmatched_files: true - files: ${{ steps.archive.outputs.tgz }} + gh release create \ + --draft \ + --notes-file release_notes.txt \ + --title v${{ inputs.version }} \ + v${{ inputs.version }} \ + rules_nixpkgs-${{ inputs.version }}.tar.gz diff --git a/.github/workflows/release_prep.sh b/.github/workflows/release_prep.sh new file mode 100755 index 000000000..e51a2c9f1 --- /dev/null +++ b/.github/workflows/release_prep.sh @@ -0,0 +1,40 @@ +#!/usr/bin/env bash +set -euo pipefail + +TAG=$1 +REPO_NAME=${GITHUB_REPOSITORY#*/} +# The prefix is chosen to match what GitHub generates for source archives +PREFIX="${REPO_NAME}-${TAG:1}" +ARCHIVE="${REPO_NAME}-${TAG:1}.tar.gz" +git archive --format=tar.gz --prefix="${PREFIX}/" -o $ARCHIVE HEAD +SHA=$(shasum -a 256 "$ARCHIVE" | awk '{print $1}') + +cat << EOF +## Using Bzlmod with Bazel 6+ + +1. Enable with \`common --enable_bzlmod\` in \`.bazelrc\`. +2. Add to your \`MODULE.bazel\` file: + +\`\`\`starlark +bazel_dep(name = "${REPO_NAME}", version = "${TAG:1}") +\`\`\` + +## Using WORKSPACE + +Paste this snippet into your \`WORKSPACE.bazel\` file: + +\`\`\`starlark +load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") + +http_archive( + name = "${REPO_NAME}", + sha256 = "${SHA}", + strip_prefix = "$PREFIX", + urls = ["https://github.com/$GITHUB_REPOSITORY/releases/download/$TAG/$ARCHIVE"], +) + +load("@${REPO_NAME}//haskell:repositories.bzl", "${REPO_NAME}_dependencies") + +${REPO_NAME}_dependencies() +\`\`\` +EOF From 81d9af90e662b0df89cd69ef8bf19a7fcf4edb1a Mon Sep 17 00:00:00 2001 From: Claudio Bley Date: Mon, 9 Sep 2024 11:32:20 +0200 Subject: [PATCH 02/12] Remove old prepare snippets script --- .github/workflows/prepare_snippets.sh | 40 --------------------------- 1 file changed, 40 deletions(-) delete mode 100755 .github/workflows/prepare_snippets.sh diff --git a/.github/workflows/prepare_snippets.sh b/.github/workflows/prepare_snippets.sh deleted file mode 100755 index f90753060..000000000 --- a/.github/workflows/prepare_snippets.sh +++ /dev/null @@ -1,40 +0,0 @@ -#!/usr/bin/env bash - -set -o errexit -o nounset -o pipefail - -ARCHIVE="$1" - -# Set by GH actions, see -# https://docs.github.com/en/actions/learn-github-actions/environment-variables#default-environment-variables -TAG=${GITHUB_REF_NAME} -REPO_NAME=${GITHUB_REPOSITORY#*/} -PREFIX="${REPO_NAME}-${TAG:1}" -URL="https://github.com/${GITHUB_REPOSITORY}/releases/download/$TAG/$ARCHIVE" - -if ! SHA=$( shasum -a 256 "$ARCHIVE" | awk '{print $1}'); then - echo "error: could not determine hash for ${ARCHIVE}" >&2 - exit 1 -fi - -cat << EOF -## Using bzlmod with Bazel 6 - -1. Enable with \`common --enable_bzlmod\` in \`.bazelrc\`. -2. Add to your \`MODULE.bazel\` file: - -\`\`\`starlark -bazel_dep(name = "rules_haskell", version = "${TAG:1}") -\`\`\` - -## Using WORKSPACE - -\`\`\`starlark -load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") -http_archive( - name = "${REPO_NAME}", - sha256 = "${SHA}", - strip_prefix = "${PREFIX}", - url = "${URL}", -) -\`\`\` -EOF From 15cfc5cabc45c53daf769a2c8c4759ea5c464407 Mon Sep 17 00:00:00 2001 From: Claudio Bley Date: Wed, 11 Sep 2024 13:58:31 +0200 Subject: [PATCH 03/12] Test Bazel 6 and 7 on Bazel CI --- .bazelci/presubmit.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.bazelci/presubmit.yml b/.bazelci/presubmit.yml index fab29efc2..8ed5d73ad 100644 --- a/.bazelci/presubmit.yml +++ b/.bazelci/presubmit.yml @@ -1,9 +1,13 @@ --- matrix: + bazel: + - 6.x + - 7.x workdir: [".", "rules_haskell_tests"] tasks: ubuntu1804: + bazel: ${{ bazel }} working_directory: ${{ workdir }} platform: "ubuntu1804" environment: From 44575cbcafc42a720e5e04ce74785db0098a550a Mon Sep 17 00:00:00 2001 From: Claudio Bley Date: Wed, 11 Sep 2024 14:09:50 +0200 Subject: [PATCH 04/12] Infer repository name from `GITHUB_REPOSITORY` variable --- .github/workflows/prepare-release.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/prepare-release.yaml b/.github/workflows/prepare-release.yaml index 6401c5c54..e95bc8f87 100644 --- a/.github/workflows/prepare-release.yaml +++ b/.github/workflows/prepare-release.yaml @@ -46,4 +46,4 @@ jobs: --notes-file release_notes.txt \ --title v${{ inputs.version }} \ v${{ inputs.version }} \ - rules_nixpkgs-${{ inputs.version }}.tar.gz + ${GITHUB_REPOSITORY#*/}-${{ inputs.version }}.tar.gz From 9884af4a63ca13028d05653984456bee644654f3 Mon Sep 17 00:00:00 2001 From: Claudio Bley Date: Fri, 20 Sep 2024 13:48:41 +0200 Subject: [PATCH 05/12] Run CI for Bazel 7.x for BCR PRs --- .bcr/presubmit.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.bcr/presubmit.yml b/.bcr/presubmit.yml index 376812f6d..ddf79f3ba 100644 --- a/.bcr/presubmit.yml +++ b/.bcr/presubmit.yml @@ -9,6 +9,7 @@ matrix: #- windows bazel: - 6.x + - 7.x tasks: verify_targets: name: Verify build targets From bcaa7afe1c1feaf22712b8749a5e028970aaf609 Mon Sep 17 00:00:00 2001 From: Claudio Bley Date: Fri, 20 Sep 2024 13:49:54 +0200 Subject: [PATCH 06/12] Remove BAZEL_USE_CPP_ONLY_TOOLCHAIN from BCR presubmit This is enabled on Windows and MacOS automatically in `.bazelrc.common`. --- .bcr/presubmit.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.bcr/presubmit.yml b/.bcr/presubmit.yml index ddf79f3ba..b4d5ed76e 100644 --- a/.bcr/presubmit.yml +++ b/.bcr/presubmit.yml @@ -32,7 +32,6 @@ tasks: - 'powershell -Command "Invoke-WebRequest -Uri https://hackage.haskell.org/root.json -OutFile out.json"' build_flags: - '--incompatible_enable_cc_toolchain_resolution' - - '--repo_env=BAZEL_USE_CPP_ONLY_TOOLCHAIN=1' build_targets: - '@rules_haskell//haskell/...' - '@rules_haskell//tools/...' From ed3077fc39621f8594b2dfc52de0a2486eeeeb9e Mon Sep 17 00:00:00 2001 From: Claudio Bley Date: Mon, 23 Sep 2024 10:40:51 +0200 Subject: [PATCH 07/12] Simplify release process 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. --- .github/ISSUE_TEMPLATE/release.md | 34 +++++++------------------- .github/workflows/publish.yaml | 40 ++++++++++++++++++++++++++++--- 2 files changed, 45 insertions(+), 29 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/release.md b/.github/ISSUE_TEMPLATE/release.md index 382a17818..b2a17eaa7 100644 --- a/.github/ISSUE_TEMPLATE/release.md +++ b/.github/ISSUE_TEMPLATE/release.md @@ -23,33 +23,15 @@ about: Steps to work through in order to publish a new release - [ ] Create "Added", "Removed", "Changed" and "Fixed" sections, as necessary. - [ ] If relevant, add links to the corresponding PRs to the entries. -- [ ] Set the revision in [the `start` script][start] and - [`docs/haskell-use-cases`][usecases] to the current release - preparation branch; comment out the checksum. (n.b., Search for - `http_archive` in these files.) - [ ] Update the version of the modules in `MODULE.bazel` files -- [ ] Push the `release-.` branch and open a **draft** PR - to verify CI is green. -- [ ] Create a release tag (`v.`) on the release - preparation branch and push the tag; or use Github's UI. -- [ ] Go to the [release page][releases]: - - [ ] Open the corresponding draft release and copy the workspace snippet. - - [ ] Insert the workspace snippet into [the `start` script][start] - and [`docs/haskell-use-cases`][usecases] replacing the existing snippet. -- [ ] Push the changes to the remote branch and mark the PR as ready; - go through review and merge to `master` upon success. - - If any changes need to be made, upon review, you will need to delete - the release tag (from local and origin) and repeat the previous four - steps appropriately before requesting a follow-up review. - - If there are changes on the release preparation branch that should - *not* go to `master`, create a second branch - `release-.-master` on `master` and cherry-pick all - relevant commits from the release branch preparation branch. Open a - pull request with that branch, go through review and push changes - back to the release preparation branch. -- [ ] Go to the [release page][releases]: - - [ ] Open the draft release for the current version. - - [ ] Release. +- [ ] Push the `release-.` branch and open a PR; go through review and merge upon success. +- [ ] Trigger the `Prepare Release` workflow + - either via the Github UI **or** + - run `gh workflow run -f version=. 'Prepare Release'` using the Github CLI +- [ ] Go to the [releases], open the draft release which was created to inspect it + - Do the code snippets look valid? + - Is there a release artifact attached to it? + - If you're happy, publish the release... :rocket: - [ ] After the "Publish" workflow is finished check whether https://haskell.build/start is now the latest [`start` script][start] (Netlify sometimes has problems). - [ ] Announce the new version on Twitter by asking someone with access. diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index 5ae69a648..41e8ca857 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -2,7 +2,7 @@ name: Publish on: release: - types: [published] + types: [released] workflow_dispatch: # allows manual triggering jobs: @@ -21,5 +21,39 @@ jobs: git config user.email github-actions@github.com - name: Merge master into release run: git merge --no-edit origin/master - - name: Push - run: git push + - name: Fetch latest release artifact + id: latest + env: + GH_TOKEN: ${{ github.token }} + 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 -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 = "` + 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: | + if ! git diff --exit-code ; then + 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 + fi From 0867f767e7239f61365aa62b162ac053a6c0d9e8 Mon Sep 17 00:00:00 2001 From: Claudio Bley Date: Mon, 23 Sep 2024 10:54:06 +0200 Subject: [PATCH 08/12] Add job summary with release URL --- .github/workflows/prepare-release.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/prepare-release.yaml b/.github/workflows/prepare-release.yaml index e95bc8f87..d308ddffa 100644 --- a/.github/workflows/prepare-release.yaml +++ b/.github/workflows/prepare-release.yaml @@ -46,4 +46,6 @@ jobs: --notes-file release_notes.txt \ --title v${{ inputs.version }} \ v${{ inputs.version }} \ - ${GITHUB_REPOSITORY#*/}-${{ inputs.version }}.tar.gz + ${GITHUB_REPOSITORY#*/}-${{ inputs.version }}.tar.gz | tee release_url + - name: Write summary + run: 'echo ":rocket: Draft release created [here]($( cat release_url ))" >> "${GITHUB_STEP_SUMMARY}"' From 5ec59ba015ec6456d5af27141cdc5bb79ae30dd6 Mon Sep 17 00:00:00 2001 From: Claudio Bley Date: Mon, 23 Sep 2024 12:13:00 +0200 Subject: [PATCH 09/12] Prepare release 1.0 --- CHANGELOG.md | 31 +++++++++++++++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bc612e838..af10a27f2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,14 +3,41 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/). -## Next release + +## [1.0] 2024-09-23 + +[1.0]: https://github.com/tweag/rules_haskell/compare/v0.19...v1.0 + +### Highlights + +* Support for Bazel 7 (see https://github.com/tweag/rules_haskell/pull/2232) +* Support for GHC 9.8.x (see https://github.com/tweag/rules_haskell/pull/2132) + +### Added + +* Support for unit-based hie-bios script for ghc 9.4+ (See https://github.com/tweag/rules_haskell/pull/2218) +* Preliminary support for GHC 9.10.x (See https://github.com/tweag/rules_haskell/pull/2198) + +### Fixed + +* Handle RTS library for GHC 9.4+ (See https://github.com/tweag/rules_haskell/pull/2202) +* Error when building cabal sub-libraries (See https://github.com/tweag/rules_haskell/pull/2135) ### Changed * Use ghc 9.4.6 by default * Use Bazel 6.5.0 by default (See https://github.com/tweag/rules_haskell/pull/2117) +* Update nixpkgs revision to nixos-24.05, + **note***: requires rules\_nixpkgs version >= 0.12 (See https://github.com/tweag/rules_haskell/pull/2217) +* Asterius is deprecated and not tested anymore (See https://github.com/tweag/rules_haskell/pull/2182) +* No longer create empty libraries (See https://github.com/tweag/rules_haskell/pull/2158) +* Make static linking of haskell_cabal_binary explicit (See https://github.com/tweag/rules_haskell/pull/2148) + +### Removed + +* Testing GHC 9.2.x on CI -## [0.19] 2024-02-5 +## [0.19] 2024-02-07 [0.19]: https://github.com/tweag/rules_haskell/compare/v0.18...v0.19 From 250d36824901daadc821e1a011a9eec50b7af2bf Mon Sep 17 00:00:00 2001 From: Claudio Bley Date: Mon, 23 Sep 2024 12:21:17 +0200 Subject: [PATCH 10/12] Use place holder values for rules_haskell attrs in start script and docs This ensures that we don't accidentally run tests on old releases. --- docs/haskell-use-cases.rst | 6 +++--- start | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/docs/haskell-use-cases.rst b/docs/haskell-use-cases.rst index cd32a25b4..4f50bc01a 100644 --- a/docs/haskell-use-cases.rst +++ b/docs/haskell-use-cases.rst @@ -28,9 +28,9 @@ rules_haskell. To use a released version, do the following:: http_archive( name = "rules_haskell", - sha256 = "34742848a8882d94a0437b3b1917dea6f58c82fe5762afe8d249d3a36e51935d", - strip_prefix = "rules_haskell-0.19", - url = "https://github.com/tweag/rules_haskell/releases/download/v0.19/rules_haskell-0.19.tar.gz", + sha256 = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + strip_prefix = "rules_haskell-M.NN", + url = "https://github.com/tweag/rules_haskell/releases/download/vM.NN/rules_haskell-M.NN.tar.gz", ) Picking a compiler diff --git a/start b/start index e56ae1224..d28823f31 100755 --- a/start +++ b/start @@ -251,9 +251,9 @@ load( # Download rules_haskell and make it accessible as "@rules_haskell". http_archive( name = "rules_haskell", - sha256 = "34742848a8882d94a0437b3b1917dea6f58c82fe5762afe8d249d3a36e51935d", - strip_prefix = "rules_haskell-0.19", - url = "https://github.com/tweag/rules_haskell/releases/download/v0.19/rules_haskell-0.19.tar.gz", + sha256 = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + strip_prefix = "rules_haskell-M.NN", + url = "https://github.com/tweag/rules_haskell/releases/download/vM.NN/rules_haskell-M.NN.tar.gz", ) load( @@ -376,7 +376,7 @@ if $BZLMOD; then cat >MODULE.bazel < Date: Mon, 23 Sep 2024 12:29:11 +0200 Subject: [PATCH 11/12] Bump version from 0.19 to 1.0 --- MODULE.bazel | 2 +- examples/MODULE.bazel | 4 ++-- registry/modules/rules_haskell/{0.19 => 1.0}/MODULE.bazel | 0 registry/modules/rules_haskell/{0.19 => 1.0}/source.json | 0 registry/modules/rules_haskell/metadata.json | 2 +- .../modules/rules_haskell_nix/{0.19 => 1.0}/MODULE.bazel | 0 .../modules/rules_haskell_nix/{0.19 => 1.0}/source.json | 0 registry/modules/rules_haskell_nix/metadata.json | 2 +- rules_haskell_nix/MODULE.bazel | 4 ++-- rules_haskell_tests/MODULE.bazel | 6 +++--- .../tests/bzlmod_runfiles/other_module/MODULE.bazel | 4 ++-- tutorial/MODULE.bazel | 4 ++-- 12 files changed, 14 insertions(+), 14 deletions(-) rename registry/modules/rules_haskell/{0.19 => 1.0}/MODULE.bazel (100%) rename registry/modules/rules_haskell/{0.19 => 1.0}/source.json (100%) rename registry/modules/rules_haskell_nix/{0.19 => 1.0}/MODULE.bazel (100%) rename registry/modules/rules_haskell_nix/{0.19 => 1.0}/source.json (100%) diff --git a/MODULE.bazel b/MODULE.bazel index dc5ee7b00..8dba7014a 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -1,6 +1,6 @@ module( name = "rules_haskell", - version = "0.19", + version = "1.0", ) bazel_dep( diff --git a/examples/MODULE.bazel b/examples/MODULE.bazel index 80e5252ae..9236e1ccf 100644 --- a/examples/MODULE.bazel +++ b/examples/MODULE.bazel @@ -9,11 +9,11 @@ bazel_dep( ) bazel_dep( name = "rules_haskell_nix", - version = "0.19", + version = "1.0", ) bazel_dep( name = "rules_haskell", - version = "0.19", + version = "1.0", ) # TODO diff --git a/registry/modules/rules_haskell/0.19/MODULE.bazel b/registry/modules/rules_haskell/1.0/MODULE.bazel similarity index 100% rename from registry/modules/rules_haskell/0.19/MODULE.bazel rename to registry/modules/rules_haskell/1.0/MODULE.bazel diff --git a/registry/modules/rules_haskell/0.19/source.json b/registry/modules/rules_haskell/1.0/source.json similarity index 100% rename from registry/modules/rules_haskell/0.19/source.json rename to registry/modules/rules_haskell/1.0/source.json diff --git a/registry/modules/rules_haskell/metadata.json b/registry/modules/rules_haskell/metadata.json index 8500a5c7c..937cc6592 100644 --- a/registry/modules/rules_haskell/metadata.json +++ b/registry/modules/rules_haskell/metadata.json @@ -1,6 +1,6 @@ { "homepage": "", "maintainers": [], - "versions": ["0.19"], + "versions": ["1.0"], "yanked_versions": [] } diff --git a/registry/modules/rules_haskell_nix/0.19/MODULE.bazel b/registry/modules/rules_haskell_nix/1.0/MODULE.bazel similarity index 100% rename from registry/modules/rules_haskell_nix/0.19/MODULE.bazel rename to registry/modules/rules_haskell_nix/1.0/MODULE.bazel diff --git a/registry/modules/rules_haskell_nix/0.19/source.json b/registry/modules/rules_haskell_nix/1.0/source.json similarity index 100% rename from registry/modules/rules_haskell_nix/0.19/source.json rename to registry/modules/rules_haskell_nix/1.0/source.json diff --git a/registry/modules/rules_haskell_nix/metadata.json b/registry/modules/rules_haskell_nix/metadata.json index 8500a5c7c..937cc6592 100644 --- a/registry/modules/rules_haskell_nix/metadata.json +++ b/registry/modules/rules_haskell_nix/metadata.json @@ -1,6 +1,6 @@ { "homepage": "", "maintainers": [], - "versions": ["0.19"], + "versions": ["1.0"], "yanked_versions": [] } diff --git a/rules_haskell_nix/MODULE.bazel b/rules_haskell_nix/MODULE.bazel index ad904637e..d2d3d93b2 100644 --- a/rules_haskell_nix/MODULE.bazel +++ b/rules_haskell_nix/MODULE.bazel @@ -1,11 +1,11 @@ module( name = "rules_haskell_nix", - version = "0.19", + version = "1.0", ) bazel_dep( name = "rules_haskell", - version = "0.19", + version = "1.0", ) bazel_dep( name = "rules_sh", diff --git a/rules_haskell_tests/MODULE.bazel b/rules_haskell_tests/MODULE.bazel index c136ba33a..923454484 100644 --- a/rules_haskell_tests/MODULE.bazel +++ b/rules_haskell_tests/MODULE.bazel @@ -1,6 +1,6 @@ module( name = "rules_haskell_tests", - version = "0.19", + version = "1.0", ) bazel_dep( @@ -9,11 +9,11 @@ bazel_dep( ) bazel_dep( name = "rules_haskell_nix", - version = "0.19", + version = "1.0", ) bazel_dep( name = "rules_haskell", - version = "0.19", + version = "1.0", ) bazel_dep( name = "rules_license", diff --git a/rules_haskell_tests/tests/bzlmod_runfiles/other_module/MODULE.bazel b/rules_haskell_tests/tests/bzlmod_runfiles/other_module/MODULE.bazel index 66d8a325b..6147a7a7c 100644 --- a/rules_haskell_tests/tests/bzlmod_runfiles/other_module/MODULE.bazel +++ b/rules_haskell_tests/tests/bzlmod_runfiles/other_module/MODULE.bazel @@ -5,11 +5,11 @@ module( bazel_dep( name = "rules_haskell_nix", - version = "0.19", + version = "1.0", ) bazel_dep( name = "rules_haskell", - version = "0.19", + version = "1.0", ) bazel_dep( name = "rules_nixpkgs_core", diff --git a/tutorial/MODULE.bazel b/tutorial/MODULE.bazel index 57c2a6944..4c97ccde3 100644 --- a/tutorial/MODULE.bazel +++ b/tutorial/MODULE.bazel @@ -7,11 +7,11 @@ bazel_dep( # toolchains are considered first bazel_dep( name = "rules_haskell_nix", - version = "0.19", + version = "1.0", ) bazel_dep( name = "rules_haskell", - version = "0.19", + version = "1.0", ) bazel_dep( name = "rules_nixpkgs_core", From 5f64603db02dcc8e01d48916528cf38fc4f195a2 Mon Sep 17 00:00:00 2001 From: Claudio Bley Date: Mon, 23 Sep 2024 16:41:53 +0200 Subject: [PATCH 12/12] Simplify replacement of http_archive attributes --- .github/workflows/publish.yaml | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index 41e8ca857..d48991e1e 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -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