This repository includes an automated artifact publishing mechanism that:
- Builds artifacts in GitHub Actions with optimized caching
- Publishes artifacts to GitHub Releases when a tag is pushed
- Publishes packages to GitHub Packages
- Publishes container images to GitHub Container Registry
- Generates SHA256 checksums for all artifacts
To automatically publish a new release:
-
Create and push a new tag with the version number:
git tag v1.0.1 git push origin v1.0.1
-
The CI/CD pipeline will automatically:
- Build the project
- Generate SHA256 checksums for artifacts
- Create a GitHub Release with the artifacts and checksums
- Publish the package to GitHub Packages
- Publish container images to GitHub Container Registry
You can also manually trigger the publishing workflow:
- Go to the Actions tab in the GitHub repository
- Select the "CI/CD Pipeline - Test, Build and Publish" workflow
- Click "Run workflow"
- Choose to publish to GitHub Packages and/or Container Registry
- Click "Run workflow"
No additional secrets are required for GitHub Packages or Container Registry publishing as they use the automatically provided GITHUB_TOKEN.
To install the package from GitHub Packages:
-
Create or update your
.npmrcfile:@OWNER:registry=https://npm.pkg.github.com //npm.pkg.github.com/:_authToken=YOUR_GITHUB_TOKEN -
Install the package:
npm install @OWNER/public-repo
Replace OWNER with the GitHub username or organization name, and YOUR_GITHUB_TOKEN with a personal access token that has read:packages scope.
To download the release archive:
- Go to the repository's Releases page
- Find the desired release version
- Download the
public-repo-VERSION.zipfile
To pull the container image:
docker pull ghcr.io/OWNER/public-repo:latest
# or a specific version
docker pull ghcr.io/OWNER/public-repo:1.0.1Replace OWNER with the GitHub username or organization name.
All published artifacts include SHA256 checksums for verification.
A verification script is provided to simplify the process:
./scripts/verify-checksum.sh OWNER VERSIONFor example:
./scripts/verify-checksum.sh myusername 1.0.1Or manually verify:
# Download the artifact and checksum
curl -LO https://github.com/OWNER/public-repo/releases/download/vVERSION/public-repo-VERSION.zip
curl -LO https://github.com/OWNER/public-repo/releases/download/vVERSION/public-repo-VERSION.zip.sha256
# Verify the checksum
echo "$(cat public-repo-VERSION.zip.sha256) public-repo-VERSION.zip" | sha256sum --checkReplace OWNER with the GitHub username or organization name and VERSION with the release version.