From d705e50884d9647ddff3fc1b08d96c9cd4ce530a Mon Sep 17 00:00:00 2001 From: Ezekiel Warren Date: Tue, 12 Sep 2023 05:19:27 -0700 Subject: [PATCH] automatically create and upload bzlmod archive (#294) --- .github/workflows/bzlmod-archive.yml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 .github/workflows/bzlmod-archive.yml diff --git a/.github/workflows/bzlmod-archive.yml b/.github/workflows/bzlmod-archive.yml new file mode 100644 index 0000000..0c117ff --- /dev/null +++ b/.github/workflows/bzlmod-archive.yml @@ -0,0 +1,19 @@ +name: Bzlmod Archive + +on: + release: + types: [published] + +jobs: + # A release archive is required for bzlmod + # See: https://blog.bazel.build/2023/02/15/github-archive-checksum.html + upload-archive: + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - uses: actions/checkout@v4 + - run: git archive -o "${{ format('{0}-{1}.tar.gz', github.event.repository.name, github.event.release.tag_name) }}" HEAD + - run: gh release upload ${{ github.event.release.tag_name }} *.tar.gz + env: + GH_TOKEN: ${{ github.token }}