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
8 changes: 0 additions & 8 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,6 @@ jobs:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install jq
run: |
if ! command -v jq >/dev/null; then
sudo apt-get update
sudo apt-get install -y jq
fi
- name: get secrets
uses: launchdarkly/gh-actions/actions/[email protected]
with:
Expand All @@ -58,8 +52,6 @@ jobs:
fi

make build
- name: prepare release
run: ./scripts/release/prepare-release.sh
- name: publish
run: |
if [[ "$DRY_RUN" = true ]]; then
Expand Down
29 changes: 23 additions & 6 deletions scripts/release/prepare-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,18 @@

set -euo pipefail

RELEASE_TAG="v${LD_RELEASE_VERSION}"
release_tag="v${LD_RELEASE_VERSION}"

stage_artifacts() (
local target=$1

echo "$DOCKER_TOKEN" | sudo docker login --username "$DOCKER_USERNAME" --password-stdin

sudo PATH="$PATH" GITHUB_TOKEN="$GITHUB_TOKEN" make "$target"

mkdir -p "$ARTIFACT_DIRECTORY"
cp ./dist/*.deb ./dist/*.rpm ./dist/*.tar.gz ./dist/*.txt "$ARTIFACT_DIRECTORY"
)

update_go() (
sed -i "s/const Version =.*/const Version = \"${LD_RELEASE_VERSION}\"/g" internal/version/version.go
Expand All @@ -14,7 +25,7 @@ update_orb() (
)

update_gha() (
sed -i "s#launchdarkly/find-code-references@v.*#launchdarkly/find-code-references@${RELEASE_TAG}#g" build/metadata/github-actions/README.md
sed -i "s#launchdarkly/find-code-references@v.*#launchdarkly/find-code-references@${release_tag}#g" build/metadata/github-actions/README.md
sed -i "s#launchdarkly/ld-find-code-refs-github-action:.*#launchdarkly/ld-find-code-refs-github-action:${LD_RELEASE_VERSION}#g" build/metadata/github-actions/Dockerfile
)

Expand All @@ -23,7 +34,13 @@ update_bitbucket() (
sed -i "s#image: launchdarkly/ld-find-code-refs-bitbucket-pipeline:.*#image: launchdarkly/ld-find-code-refs-bitbucket-pipeline:${LD_RELEASE_VERSION}#g" build/metadata/bitbucket/pipe.yml
)

update_go
update_orb
update_gha
update_bitbucket
prepare_release() (
# create artifacts with goreleaser
stage_artifacts $1

# update metadata files
update_go
update_orb
update_gha
update_bitbucket
)
4 changes: 2 additions & 2 deletions scripts/release/publish-dry-run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

set -euo pipefail

source $(dirname $0)/stage-artifacts.sh
stage_artifacts products-for-release
source $(dirname $0)/prepare_release.sh
prepare_release products-for-release

# Copy the Docker image that goreleaser just built into the artifacts - we only do
# this in a dry run, because in a real release the image will be available from
Expand Down
4 changes: 2 additions & 2 deletions scripts/release/publish.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

set -euo pipefail

source $(dirname $0)/stage-artifacts.sh
stage_artifacts publish
source $(dirname $0)/prepare-release.sh
prepare_release publish

# make bitbucket and github known hosts to push successfully
mkdir -m700 ~/.ssh
Expand Down
14 changes: 0 additions & 14 deletions scripts/release/stage-artifacts.sh

This file was deleted.

Loading