Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
120 changes: 35 additions & 85 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Release builder
name: Release

on:
push:
Expand All @@ -25,33 +25,50 @@ env:
IMAGE: ghcr.io/flowcanon/flow-deploy-docs

jobs:
detect_release:
name: Detect release
release:
runs-on: ubuntu-latest
steps:
- id: pipeline
uses: flowcanon/release-builder/pipeline@v3
with:
force-pr: ${{ inputs.force_pr || false }}
outputs:
created-tag: ${{ steps.pipeline.outputs.created-tag }}
current-version: ${{ steps.pipeline.outputs.current-version }}

build_release:
if: inputs.force_release || needs.release.outputs.created-tag
name: Build release
runs-on: ubuntu-latest
needs: release
permissions:
contents: write

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- run: command -v poetry || pipx install poetry
- id: tag
uses: salsify/action-detect-and-tag-new-version@v2
with:
version-command: poetry version --short
tag-annotation-template: |
chore(release): {VERSION}
- name: Build binaries
run: |
docker build --target builder-musl -t flow-deploy-musl -f Dockerfile.build .
docker build --target builder-glibc -t flow-deploy-glibc -f Dockerfile.build .
mkdir -p dist
docker cp $(docker create flow-deploy-musl):/build/dist/flow-deploy-linux-musl dist/
docker cp $(docker create flow-deploy-glibc):/build/dist/flow-deploy-linux-glibc dist/

outputs:
created_tag: ${{ steps.tag.outputs.tag }}
current-version: ${{ steps.tag.outputs.current-version }}
previous-version: ${{ steps.tag.outputs.previous-version }}
- name: Create GitHub release
uses: softprops/action-gh-release@v2
with:
tag_name: v${{ needs.release.outputs.current-version }}
generate_release_notes: true
files: |
dist/flow-deploy-linux-musl
dist/flow-deploy-linux-glibc

build_and_deploy:
if: inputs.force_deploy || needs.detect_release.outputs.created_tag
if: inputs.force_deploy || needs.release.outputs.created-tag
name: Build & Deploy
runs-on: ubuntu-latest
needs: [detect_release, build_release]
needs: [release, build_release]
environment: coruscant
permissions:
contents: read
Expand Down Expand Up @@ -88,70 +105,3 @@ jobs:
ssh-port: ${{ vars.SSH_PORT }}
registry-token: ${{ secrets.GITHUB_TOKEN }}
upgrade: true

build_release:
if: inputs.force_release || needs.detect_release.outputs.created_tag
name: Build release
runs-on: ubuntu-latest
needs: detect_release
permissions:
contents: write

steps:
- uses: actions/checkout@v4

- name: Build binaries
run: |
docker build --target builder-musl -t flow-deploy-musl -f Dockerfile.build .
docker build --target builder-glibc -t flow-deploy-glibc -f Dockerfile.build .
mkdir -p dist
docker cp $(docker create flow-deploy-musl):/build/dist/flow-deploy-linux-musl dist/
docker cp $(docker create flow-deploy-glibc):/build/dist/flow-deploy-linux-glibc dist/

- name: Create GitHub release
uses: softprops/action-gh-release@v2
with:
tag_name: v${{ needs.detect_release.outputs.current-version }}
generate_release_notes: true
files: |
dist/flow-deploy-linux-musl
dist/flow-deploy-linux-glibc

build_changelog:
name: Build changelog
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- id: changelog
uses: flowcanon/release-builder/build-changelog@v2

outputs:
has-prs: ${{ steps.changelog.outputs.has-prs }}
previous-version: ${{ steps.changelog.outputs.previous-version }}
next-version: ${{ steps.changelog.outputs.next-version }}
notes: ${{ steps.changelog.outputs.notes }}
release: ${{ steps.changelog.outputs.release }}

create_pr:
if: always() && inputs.force_pr || needs.build_changelog.outputs.has-prs
name: Create pull request
runs-on: ubuntu-latest
needs: build_changelog

steps:
- uses: actions/checkout@v4

- uses: flowcanon/release-builder/package-version@v2
with:
version: ${{ needs.build_changelog.outputs.next-version }}

- uses: flowcanon/release-builder/pull-request@v2
with:
next-version: ${{ needs.build_changelog.outputs.next-version }}
notes: ${{ needs.build_changelog.outputs.notes }}
previous-version: ${{ needs.build_changelog.outputs.previous-version }}
release: ${{ needs.build_changelog.outputs.release }}