diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 1af7652..e42f9ed 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -205,49 +205,6 @@ "run": "bazel run @org_golang_x_lint//golint -- -set_exit_status $(pwd)/..." } ] - }, - "publish": { - "name": "publish", - "needs": [ - "build_and_test" - ], - "runs-on": "ubuntu-latest", - "steps": [ - { - "name": "Checkout the repository", - "uses": "actions/checkout@v4 " - }, - { - "name": "Download release artifacts", - "uses": "actions/download-artifact@v4", - "with": { - "merge-multiple": true, - "path": "assets" - } - }, - { - "name": "Calculate shasum", - "run": "shasum -a 256 assets/* > sha256" - }, - { - "name": "Set release Git user", - "run": "git config --global user.email \"41898282+github-actions[bot]@users.noreply.github.com\"\ngit config --global user.name \"github-actions[bot]\"\n" - }, - { - "id": "create_tag", - "name": "Generate tag", - "run": "BUILD_SCM_REVISION=$(git rev-parse --short HEAD)\nBUILD_SCM_TIMESTAMP=$(TZ=UTC date --date \"@$(git show -s --format=%ct HEAD)\" +%Y%m%dT%H%M%SZ)\nRELEASE_TAG=\"${BUILD_SCM_TIMESTAMP}-${BUILD_SCM_REVISION}\"\ngit tag $RELEASE_TAG\ngit push --follow-tags\necho \"release_tag=$RELEASE_TAG\" >> $GITHUB_OUTPUT\n" - }, - { - "name": "Create GitHub release and upload artifacts", - "uses": "softprops/action-gh-release@v2", - "with": { - "files": "assets/*\nsha256\n", - "make_latest": true, - "tag_name": "${{ steps.create_tag.outputs.release_tag }}" - } - } - ] } }, "name": "main", diff --git a/MODULE.bazel b/MODULE.bazel index 53d1329..23e41fa 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -94,8 +94,9 @@ git_override( module_name = "com_github_buildbarn_bb_storage", commit = "d0c6f2633bb9e199fc7285687cdd677660dc688c", patches = [ - "//:patches/com_github_buildbarn_bb_storage/github-workflow-windows-2022.patch", - "//:patches/com_github_buildbarn_bb_storage/workflows-template-bazel-8.diff", + "//:patches/com_github_buildbarn_bb_storage/github-workflow-windows-2022.diff", + "//:patches/com_github_buildbarn_bb_storage/github-workflow-bazel-8.diff", + "//:patches/com_github_buildbarn_bb_storage/github-workflow-remove-publish-step.diff", ], remote = "https://github.com/buildbarn/bb-storage.git", ) diff --git a/patches/com_github_buildbarn_bb_storage/workflows-template-bazel-8.diff b/patches/com_github_buildbarn_bb_storage/github-workflow-bazel-8.diff similarity index 100% rename from patches/com_github_buildbarn_bb_storage/workflows-template-bazel-8.diff rename to patches/com_github_buildbarn_bb_storage/github-workflow-bazel-8.diff diff --git a/patches/com_github_buildbarn_bb_storage/github-workflow-remove-publish-step.diff b/patches/com_github_buildbarn_bb_storage/github-workflow-remove-publish-step.diff new file mode 100644 index 0000000..69defc5 --- /dev/null +++ b/patches/com_github_buildbarn_bb_storage/github-workflow-remove-publish-step.diff @@ -0,0 +1,65 @@ +diff --git tools/github_workflows/workflows_template.libsonnet tools/github_workflows/workflows_template.libsonnet +index 53231de..b66bede 100644 +--- tools/github_workflows/workflows_template.libsonnet ++++ tools/github_workflows/workflows_template.libsonnet +@@ -148,60 +148,6 @@ + else [] + ), + }, +- [if doUpload then 'publish']: { +- 'runs-on': 'ubuntu-latest', +- name: 'publish', +- needs: ['build_and_test'], +- steps: [ +- { +- name: 'Checkout the repository', +- uses: 'actions/checkout@v4 ', +- }, +- { +- name: 'Download release artifacts', +- uses: 'actions/download-artifact@v4', +- with: { +- 'merge-multiple': true, +- path: 'assets', +- }, +- }, +- { +- name: 'Calculate shasum', +- run: 'shasum -a 256 assets/* > sha256', +- }, +- { +- name: 'Set release Git user', +- run: ||| +- git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com" +- git config --global user.name "github-actions[bot]" +- |||, +- }, +- { +- name: 'Generate tag', +- id: 'create_tag', +- run: ||| +- BUILD_SCM_REVISION=$(git rev-parse --short HEAD) +- BUILD_SCM_TIMESTAMP=$(TZ=UTC date --date "@$(git show -s --format=%ct HEAD)" +%Y%m%dT%H%M%SZ) +- RELEASE_TAG="${BUILD_SCM_TIMESTAMP}-${BUILD_SCM_REVISION}" +- git tag $RELEASE_TAG +- git push --follow-tags +- echo "release_tag=$RELEASE_TAG" >> $GITHUB_OUTPUT +- |||, +- }, +- { +- name: 'Create GitHub release and upload artifacts', +- uses: 'softprops/action-gh-release@v2', +- with: { +- make_latest: true, +- tag_name: '${{ steps.create_tag.outputs.release_tag }}', +- files: ||| +- assets/* +- sha256 +- |||, +- }, +- }, +- ], +- }, + lint: { + 'runs-on': 'ubuntu-latest', + name: 'lint', diff --git a/patches/com_github_buildbarn_bb_storage/github-workflow-windows-2022.patch b/patches/com_github_buildbarn_bb_storage/github-workflow-windows-2022.diff similarity index 100% rename from patches/com_github_buildbarn_bb_storage/github-workflow-windows-2022.patch rename to patches/com_github_buildbarn_bb_storage/github-workflow-windows-2022.diff