diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 000000000..59ad55de8 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,45 @@ +# ******************************************************************************* +# Copyright (c) 2026 Contributors to the Eclipse Foundation +# +# See the NOTICE file(s) distributed with this work for additional +# information regarding copyright ownership. +# +# This program and the accompanying materials are made available under the +# terms of the Apache License Version 2.0 which is available at +# https://www.apache.org/licenses/LICENSE-2.0 +# +# SPDX-License-Identifier: Apache-2.0 +# ******************************************************************************* + +name: Release Module + +on: + release: + types: [published] + +permissions: + contents: write + +jobs: + archive: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + ref: ${{ github.event.release.tag_name }} + + - name: Create source archive + run: | + git archive \ + --format=tar.gz \ + --prefix="module/" \ + -o "bzlmod-${{ github.event.release.tag_name }}.tar.gz" \ + HEAD + + - name: Upload to release + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + gh release upload "${{ github.event.release.tag_name }}" \ + "bzlmod-${{ github.event.release.tag_name }}.tar.gz"