Skip to content

Commit

Permalink
Combine version bump and release workflows
Browse files Browse the repository at this point in the history
An action using the GITHUB_TOKEN cannot trigger another workflow.
So to create a new release after a version bump, we simply run the
release in the same workflow.

See
https://github.com/orgs/community/discussions/27028#discussioncomment-3254360
  • Loading branch information
ll-nick committed Nov 7, 2024
1 parent 2baee09 commit 148b9d1
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 33 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Bump version
name: Bump version and create release
on:
pull_request:
types:
Expand All @@ -8,11 +8,13 @@ on:
- github_action # TODO: Remove before merge

jobs:
build:
bump-version:
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest
permissions:
contents: write
outputs:
new_tag: ${{ steps.bump_version.outputs.new_tag }}
steps:
- name: Check out the repository
uses: actions/checkout@v4
Expand Down Expand Up @@ -48,3 +50,30 @@ jobs:
run: |
git tag ${{ steps.bump_version.outputs.new_tag }}
git push origin ${{ steps.bump_version.outputs.new_tag }}
create-release:
needs: bump-version
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Build release packages
uses: docker/build-push-action@v6
with:
tags: |
util_caching_release
push: false
target: release

- name: Copy release packages
run: |
mkdir -p /tmp/artifacts/
docker run --rm -v /tmp/artifacts:/tmp/artifacts util_caching_release cp -r /release /tmp/artifacts/
- name: Create Release
uses: ncipollo/release-action@v1
with:
artifacts: "/tmp/artifacts/release/*"
tag: ${{ needs.bump-version.outputs.new_tag }}


31 changes: 0 additions & 31 deletions .github/workflows/create-release.yaml

This file was deleted.

0 comments on commit 148b9d1

Please sign in to comment.