Skip to content

Commit

Permalink
CI: Add --prefix option to git archive (#3043)
Browse files Browse the repository at this point in the history
Without a prefix option, the result of extracting the archive is the
repository being laid out flat
which requires an extra step of making a directory and changing into it.
` tar -xvf "${SOURCE_TAR}" -C "$BUILD_NAME"`, Change into the directory
first, then perform extraction.
Running a plain `tar -xvf ghostty-source.tar.gz` on results in the
following structures
```
 .
├── build.zig
├── build.zig.zon
├── com.mitchellh.ghostty.yml
├── conformance
├── CONTRIBUTING.md
├── dist
├── example
├── flake.lock
├── flake.nix
├── ghostty-source.tar.gz
├── images
├── include
├── macos
├── Makefile
├── nix
├── PACKAGING.md
├── pkg
├── README.md
├── README_TESTERS.md
├── shell.nix
├── src
├── test
├── TODO.md
├── typos.toml
└── vendor
```
With a prefix, extracted contents are kept under a top-level directory
```
.
├── ghostty-source
│   ├── build.zig
│   ├── build.zig.zon
│   ├── com.mitchellh.ghostty.yml
│   ├── conformance
│   ├── CONTRIBUTING.md
│   ├── dist
│   ├── example
│   ├── flake.lock
│   ├── flake.nix
│   ├── images
│   ├── include
│   ├── macos
│   ├── Makefile
│   ├── nix
│   ├── PACKAGING.md
│   ├── pkg
│   ├── README.md
│   ├── README_TESTERS.md
│   ├── shell.nix
│   ├── src
│   ├── test
│   ├── TODO.md
│   ├── typos.toml
│   └── vendor
└── ghostty-source.tar.gz
```
This would be a breaking change for scripts depending on the current
archive format but it I think is easier to work with and a change that
should be made before 1.0.
  • Loading branch information
mitchellh authored Dec 21, 2024
2 parents d3de22c + c6796ce commit 896e975
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release-tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ jobs:
authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}"

- name: Create Tarball
run: git archive --format=tgz -o ghostty-source.tar.gz HEAD
run: git archive --format=tgz --prefix=ghostty-source/ -o ghostty-source.tar.gz HEAD

- name: Sign Tarball
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-tip.yml
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ jobs:
name: ghostty
authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}"
- name: Create Tarball
run: git archive --format=tgz -o ghostty-source.tar.gz HEAD
run: git archive --format=tgz --prefix=ghostty-source/ -o ghostty-source.tar.gz HEAD
- name: Sign Tarball
run: |
echo -n "${{ secrets.MINISIGN_KEY }}" > minisign.key
Expand Down

0 comments on commit 896e975

Please sign in to comment.