Skip to content
Myr

build: Create archive script

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Move the code for creating the archive from the GHA yaml into a dedicated script file.

authored by Thayne McCombs · committed by Thayne McCombs · parent 868c3a3 · Browse files · 4 files+85 added−37 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

4 files+85 added−37 removed

  • other:+85 added−37 removed

4 files+85 added−37 removed

modified:.github/workflows/CICD.yml+4 added-36 removed
203 unmodified lines
204205 - name: Create tarball206 id: package207 shell: bash208 run: bash scripts/create-archive.sh209 env:210 BIN_PATH: ${{ steps.bin.outputs.BIN_PATH }}210 version: ${{ needs.crate_metadata.outputs.version }}211 run: |212 PKG_suffix=".tar.gz"213 case ${target} in214 *-pc-windows-*) PKG_suffix=".zip" ;;215 esac216 PKG_BASENAME=${name}-v${version}-${target}217 PKG_NAME=${PKG_BASENAME}${PKG_suffix}218 echo "PKG_NAME=${PKG_NAME}" >> $GITHUB_OUTPUT211 TARGET: ${{ env.target }}212 ARCHIVE_NAME: ${{ env.name }}-v${{ needs.crate_metadata.outputs.version }}-${{ env.target }}213 PKG_STAGING: "${{ env.CICD_INTERMEDIATES_DIR }}/package"214220 PKG_STAGING="${CICD_INTERMEDIATES_DIR}/package"221 ARCHIVE_DIR="${PKG_STAGING}/${PKG_BASENAME}/"222 mkdir -p "${ARCHIVE_DIR}"223224 # Binary225 cp "${BIN_PATH}" "$ARCHIVE_DIR"226227 # README, LICENSE and CHANGELOG files228 cp "README.md" "LICENSE-MIT" "LICENSE-APACHE" "CHANGELOG.md" "$ARCHIVE_DIR"229230 # Man page231 cp "doc/${name}.1" "$ARCHIVE_DIR"232233 # Autocompletion files234 cp -r autocomplete "${ARCHIVE_DIR}"235236 # base compressed package237 pushd "${PKG_STAGING}/" >/dev/null238 case ${target} in239 *-pc-windows-*) 7z -y a "${PKG_NAME}" "${PKG_BASENAME}"/* | tail -2 ;;240 *) tar czf "${PKG_NAME}" "${PKG_BASENAME}"/* ;;241 esac;242 popd >/dev/null243244 # Let subsequent steps know where to find the compressed package245 echo "PKG_PATH=${PKG_STAGING}/${PKG_NAME}" >> $GITHUB_OUTPUT246215 - name: Create Debian package216 id: debian-package217 shell: bash218 if: startsWith(matrix.job.os, 'ubuntu')
59 unmodified lines
added:scripts/create-archive.sh+67 added
modified:.gitignore+1 added
1target/2/autocomplete/3/package/4**/*.rs.bk
modified:Makefile+13 added-1 removed
1PROFILE=release1PROFILE?=release2EXE=target/$(PROFILE)/fd3prefix=/usr/local4bindir=$(prefix)/bin5datadir=$(prefix)/share6exe_name=fd7ifdef VERSION8 ARCHIVE_NAME = fd-v$(VERSION)9else10 ARCHIVE_NAME = fd11endif12export ARCHIVE_NAME13archive_path=package/$(ARCHIVE_NAME).tar.gz1415$(EXE): Cargo.toml src/**/*.rs16 cargo build --profile $(PROFILE) --locked17
29 unmodified lines
47autocomplete/fdfind.fish: contrib/completion/fdfind.fish48 $(comp_dir)49 cp $< $@5051archive: $(archive_path)5253$(archive_path): completions $(EXE)54 bash scripts/create-archive.sh5556install: $(EXE) completions57 install -Dm755 $(EXE) $(DESTDIR)$(bindir)/fd58 install -Dm644 autocomplete/fd.bash $(DESTDIR)/$(datadir)/bash-completion/completions/$(exe_name)59 install -Dm644 autocomplete/fd.fish $(DESTDIR)/$(datadir)/fish/vendor_completions.d/$(exe_name).fish
5 unmodified lines