fix: fix collections init issue #133
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Release | |
on: | |
push: | |
tags: | |
# SemVer regex taken from https://semver.org/#is-there-a-suggested-regular-expression-regex-to-check-a-semver-string | |
# Added option to start with a v for cases like v0.0.1 | |
- "[0-9]+.[0-9]+.[0-9]+-rc[0-9]*" | |
- "[0-9]+.[0-9]+.[0-9]+-alpha[0-9]*" | |
- "[0-9]+.[0-9]+.[0-9]+-beta[0-9]*" | |
- "[0-9]+.[0-9]+.[0-9]+" | |
- "v[0-9]+.[0-9]+.[0-9]+-rc[0-9]*" | |
- "v[0-9]+.[0-9]+.[0-9]+-alpha[0-9]*" | |
- "v[0-9]+.[0-9]+.[0-9]+-beta[0-9]*" | |
- "v[0-9]+.[0-9]+.[0-9]+" | |
permissions: | |
contents: write | |
pull-requests: write | |
packages: write | |
concurrency: | |
group: ci-${{ github.ref }}-${{ github.workflow }} | |
cancel-in-progress: true | |
env: | |
REGISTRY_IMAGE: ghcr.io/sedaprotocol/seda-chain | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
ref: ${{ github.event.inputs.release_tag }} | |
- name: 🐳 Docker meta | |
id: meta | |
uses: docker/metadata-action@v5 | |
with: | |
images: ${{ env.REGISTRY_IMAGE }} | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: 🐳 Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: 🐳 Login to GitHub Container Registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: 🔨 Build Binaries | |
run: | | |
export VERSION=$(echo $(git describe --tags --always --match "v*") | sed 's/^v//') | |
export COMMIT=$(git log -1 --format='%H') | |
docker build -t seda-static -f ./dockerfiles/Dockerfile.build-static \ | |
--build-arg GIT_VERSION="$VERSION" \ | |
--build-arg GIT_COMMIT="$COMMIT" . | |
mkdir build | |
docker run --rm -v $(pwd)/build:/output seda-static cp -r /build/. /output/ | |
- name: 🐳 Build and Push | |
id: build | |
uses: docker/build-push-action@v5 | |
with: | |
context: . | |
file: ./dockerfiles/Dockerfile.release | |
labels: ${{ steps.meta.outputs.labels }} | |
push: true | |
cache-from: type=gha | |
cache-to: type=gha,mode=max | |
platforms: linux/amd64,linux/arm64 | |
outputs: type=image,name=${{ env.REGISTRY_IMAGE }},name-canonical=true,push=true | |
tags: ${{ env.REGISTRY_IMAGE }}:${{ github.ref_name }}, ${{ env.REGISTRY_IMAGE }}:latest | |
- name: 🪵 Conventional Changelog | |
id: changelog | |
uses: TriPSs/conventional-changelog-action@v3 | |
with: | |
github-token: ${{ secrets.github_token }} | |
output-file: "false" | |
skip-commit: true | |
skip-tag: true | |
skip-git-pull: true | |
git-push: false | |
- name: 🧾 Generate Checksum | |
uses: jmgilman/actions-generate-checksum@v1 | |
with: | |
patterns: | | |
build/sedad-amd64 | |
build/sedad-arm64 | |
- name: 📦 Create GitHub Release | |
uses: ncipollo/release-action@v1 | |
with: | |
allowUpdates: true | |
generateReleaseNotes: true | |
body: ${{ steps.changelog.outputs.clean_changelog }} | |
artifacts: "checksum.txt,build/sedad-amd64,build/sedad-arm64" |