Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions .github/workflows/reusable-publish-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -172,12 +172,19 @@ jobs:
done < "$RUNNER_TEMP/tags.txt"

# Copy the source channel onto the published channel(s), preserving the others, then guard that
# every tag the published feed references exists before pushing.
# every tag the published feed references exists before pushing. On the first release the publish
# branch doesn't exist yet, so seed the worktree from the released commit and let the final push
# create it.
- name: Publish to the publish branch
run: |
set -euo pipefail
git fetch origin "${{ inputs.publish-branch }}:refs/remotes/origin/${{ inputs.publish-branch }}"
git worktree add --detach _publish "origin/${{ inputs.publish-branch }}"
if git ls-remote --exit-code --heads origin "${{ inputs.publish-branch }}" >/dev/null 2>&1; then
git fetch origin "${{ inputs.publish-branch }}:refs/remotes/origin/${{ inputs.publish-branch }}"
git worktree add --detach _publish "origin/${{ inputs.publish-branch }}"
else
echo "Publish branch '${{ inputs.publish-branch }}' doesn't exist yet — bootstrapping it from the released commit."
git worktree add --detach _publish HEAD
fi
rsync -a --delete \
--exclude '.git' --exclude '_publish' --exclude '_depctrl' \
--exclude 'ctrf' --exclude 'types' --exclude 'build' \
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -823,7 +823,7 @@ DependencyControl's own feed URL served from `master` through v0.6.x; from v0.7.

### Using the workflows in your own package

1. **Set up the branches.** Make your dev branch the default and create a publish branch. In your feed, give each package a single dev channel (its name is the `source-channel` input, default `main`); the release workflow creates the published channels.
1. **Set up the branches.** Make your dev branch the default. The first release creates the publish branch for you, so you needn't create it by hand. In your feed, give each package a single dev channel (its name is the `source-channel` input, default `main`); the release workflow creates the published channels.
2. **Add two thin caller workflows** that pin a DependencyControl version and pass your layout. A publish caller (`.github/workflows/release.yml`):

```yaml
Expand Down
Loading