Skip to content

Commit

Permalink
ci: archive release source
Browse files Browse the repository at this point in the history
Upon release, eagerly provide a stable archive of the release source.

It used to be that GitHub's (and GitLab's?) virtual source code assets
were generated on demand to limit resource consumption. This meant the
assets were not reliably available, and that two instances of the same
asset downloaded long apart could be generated with different
implementations, causing different checksums for the same contents.
Eventually somebody raised an overly dramatic stink about this and
GitHub promised to make the archive generation stable but I don't want
to rely on that promise.
  • Loading branch information
commonquail committed Nov 11, 2023
1 parent 6397ffd commit f729c3a
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,41 @@ permissions:

jobs:

archive-src:
name: archive-src
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v4
with:
persist-credentials: false

- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install --yes --no-install-recommends \
lzip
- name: Archive source code
shell: bash
run: |
v="${GITHUB_REF#refs/tags/}"
release_name="commitmsgfmt-$v"
asset_name="${release_name}.tar.lz"
git archive --prefix="${release_name}/" --format=tar "$v" |
lzip -6 >"$asset_name"
printf 'ASSET=%s\n' "$asset_name" >> $GITHUB_ENV
printf 'RELEASE_VERSION=%s\n' "$v" >> $GITHUB_ENV
- name: Upload source code archive
uses: softprops/action-gh-release@v1
with:
draft: true
tag_name: ${{ env.RELEASE_VERSION }}
files: ${{ env.ASSET }}

build-package:
name: build-package
runs-on: ${{ matrix.os }}
Expand Down

0 comments on commit f729c3a

Please sign in to comment.