Skip to content

Build and release (started by @vitropy) #267

Build and release (started by @vitropy)

Build and release (started by @vitropy) #267

---
name: Build and release
run-name: Build and release (started by @${{ github.triggering_actor }})
on:
push:
tags:
# First, match SemVer.org conformant tags in the `release/` tagspace.
- release/v[0-9]+.[0-9]+.[0-9]+-?** # Release, or pre-release build.
- release/v[0-9]+.[0-9]+.[0-9]+\+?** # Release with build identifier.
# Then, also, basically any release-ish name in the `test/` tagspace.
- test/**release/**
schedule:
# Build the default branch weekly. Our version of "nightly."
- cron: 55 4 * * 0 # Every Sunday at 4:55 AM.
jobs:
git-ref-basename:
uses: ./.github/workflows/git-ref-basename.yaml
build-entropy:
uses: ./.github/workflows/container-build-and-push.yaml
needs:
- git-ref-basename
with:
docker_build_arg_package: entropy
git_ref_basename: ${{ needs.git-ref-basename.outputs.git_ref_basename }}
secrets:
DOCKER_HUB_USERNAME: ${{ secrets.DOCKER_HUB_USERNAME }}
DOCKER_HUB_CI_TOKEN: ${{ secrets.DOCKER_HUB_CI_TOKEN }}
CI_MACHINE_USER_TOKEN: ${{ secrets.CI_MACHINE_USER_TOKEN }}
build-entropy-tss:
uses: ./.github/workflows/container-build-and-push.yaml
needs:
- git-ref-basename
with:
docker_build_arg_package: entropy-tss
git_ref_basename: ${{ needs.git-ref-basename.outputs.git_ref_basename }}
secrets:
DOCKER_HUB_USERNAME: ${{ secrets.DOCKER_HUB_USERNAME }}
DOCKER_HUB_CI_TOKEN: ${{ secrets.DOCKER_HUB_CI_TOKEN }}
CI_MACHINE_USER_TOKEN: ${{ secrets.CI_MACHINE_USER_TOKEN }}
release:
name: Publish new release
if: github.event_name != 'schedule'
needs:
- git-ref-basename
- build-entropy
- build-entropy-tss
permissions:
contents: write
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
pattern: "!*.dockerbuild"
- name: Create release
env:
GH_TOKEN: ${{ github.token }}
run: |
gh release create \
--draft \
--target "${{ github.sha }}" \
--title "${{ needs.build.outputs.git_ref_basename }}" \
$(echo ${{ github.ref_name }} | grep --quiet -E '^test|v[0-9]\.[0-9]\.[0-9]-' && echo '--prerelease') \
--verify-tag "${{ github.ref_name }}" \
{entropy,entropy-tss}_${{ needs.git-ref-basename.outputs.git_ref_basename }}/*