diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c22eeeef..3f7c9d22 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -33,3 +33,46 @@ jobs: - name: Run e2e tests run: npm run e2e + + build-artifact: + needs: tests_e2e + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-node@v3 + with: + node-version: 24.x + cache: npm + + - name: update + run: sudo apt update -y + + - name: apt install + run: sudo apt-get install -y git jq + + - name: build + run: | + npm install + npm run release + + - name: Get short SHA + id: short_sha + run: | + if [ "${{ github.event_name }}" == "pull_request" ]; then + echo "SHORT_SHA=$(echo ${{ github.event.pull_request.head.sha }} | cut -c1-7)" >> $GITHUB_ENV + else + echo "SHORT_SHA=$(echo ${{ github.sha }} | cut -c1-7)" >> $GITHUB_ENV + fi + + - name: Get Zonemaster-GUI version + id: version + run: | + VERSION=`jq -r '.version | sub("^v"; "")' package.json` + echo "version=$VERSION" >> $GITHUB_OUTPUT + + - name: upload artifact + uses: actions/upload-artifact@v4 + with: + name: zonemaster_web_gui_v${{ steps.version.outputs.version }}-${{ env.SHORT_SHA }} + path: zonemaster_web_gui_v${{ steps.version.outputs.version }}.zip diff --git a/README.md b/README.md index 620541fb..85c5cee9 100644 --- a/README.md +++ b/README.md @@ -41,6 +41,16 @@ Refer to the [docs](/docs) directory for detailed information on: For contribution guidelines, see [CONTRIBUTE.md](CONTRIBUTE.md). +## CI artifact + +A zip (`zonemaster_web_gui_.zip`) is built and uploaded as a GitHub Actions artifact on every push and pull request. This artifact can be useful for release testing and PR review. +To download it: +1. Go to the [Actions tab](https://github.com/zonemaster/zonemaster-gui/actions) of the repository. +2. Select a workflow run (e.g. for a specific PR or branch). +3. Scroll to the bottom of the run summary to the **Artifacts** section. +4. Download the artifact named `zonemaster_web_gui_-`. +The artifact name includes the module version and the first 7 characters of the commit SHA. + ## License This is free software under a 2-clause BSD license. The full text of the license can be found in the [LICENSE](LICENSE) file included in this repository.