bonfire-app/.github/workflows/release.yaml

372 lines
14 KiB
YAML
Raw Normal View History

2021-05-01 13:05:45 +00:00
name: Maybe release
2021-04-20 13:07:54 +00:00
on:
2021-05-01 12:34:45 +00:00
push:
2021-04-20 13:07:54 +00:00
branches:
- main
jobs:
2022-03-29 22:02:21 +00:00
# elixir_release:
# name: Elixir/OTP release without Docker
2021-04-20 13:07:54 +00:00
# runs-on: ubuntu-latest
# container: elixir:alpine
# steps:
# - uses: actions/checkout@v2
# - name: Install system deps
2022-05-23 02:42:37 +00:00
# run: apk add git npm mailcap ca-certificates openssl-dev tzdata gettext curl rust cargojust gcc libc-dev
2021-04-20 13:07:54 +00:00
# - name: Install hex
# run: mix local.hex --force
# - name: Install rebar
# run: mix local.rebar --force
# - name: Install Elixir dependencies
# run: mix deps.get --only prod
# - name: Install JS dependencies
2022-11-29 20:16:45 +00:00
# run: just js-deps-get
2021-04-20 13:07:54 +00:00
# - name: Prepare release
# run: |
# mix compile
2022-11-29 20:16:45 +00:00
# cd ./assets && yarn build && cd ..
2021-04-20 13:07:54 +00:00
# mix phx.digest
# mix release
# env:
# MIX_ENV: prod
# - name: Publish release
# uses: mayel/actions/bin/ghr@master
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# RELEASE_PATH: _build/prod/rel
2021-06-10 17:11:23 +00:00
# CI: 1
2022-01-25 19:46:45 +00:00
2022-01-25 19:49:49 +00:00
classic_flavour_common_docker_release_build_push:
2022-06-14 10:06:49 +00:00
name: Classic flavour - multiarch - Maybe tag version & release Docker image
2021-12-12 02:53:51 +00:00
runs-on: ubuntu-latest
2022-09-23 04:50:47 +00:00
permissions: write-all
2021-12-12 02:53:51 +00:00
env:
FLAVOUR: classic
FLAVOUR_PATH: flavours/classic
DOCKER_REPO: bonfire
steps:
-
name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 2 # needed for action-detect-and-tag-new-version
-
name: Maybe tag/release new version
id: version
uses: salsify/action-detect-and-tag-new-version@v2
with:
version-command: |
grep -m 1 'version:' mix.exs | cut -d '"' -f2
-
if: steps.version.outputs.current-version == steps.version.outputs.previous-version
name: Cancel workflow if the version has not changed
uses: andymckay/cancel-action@0.2
2022-09-23 04:18:04 +00:00
- name: Create tags in extensions repos
2022-09-23 06:20:47 +00:00
uses: bonfire-networks/create-tags-multirepo@v0.6
2022-09-23 04:18:04 +00:00
with:
version: ${{ steps.version.outputs.current-version }}
message: ${{ github.event.inputs.message }}
2022-09-23 05:00:51 +00:00
token: ${{ secrets.GH_TOKEN }}
2022-09-23 04:18:04 +00:00
owner: "bonfire-networks"
2022-09-23 06:22:52 +00:00
repos: "bonfire_api_graphql,bonfire_data_identity,bonfire_fail,bonfire_ui_me,bonfire_boundaries,bonfire_data_shared_user,bonfire_federate_activitypub,bonfire_quantify,bonfire_breadpub,bonfire_data_social,bonfire_files,bonfire_recyclapp,bonfire_ui_social,bonfire_classify,bonfire_geolocate,bonfire_search,bonfire_ui_valueflows,bonfire_common,bonfire_ecto,bonfire_invite_links,bonfire_social,bonfire_data_access_control,bonfire_editor_ck,bonfire_livebook,bonfire_tag,bonfire_valueflows,bonfire_data_activity_pub,bonfire_editor_quill,bonfire_mailer,bonfire_valueflows_api_schema,bonfire_data_assort,bonfire_me,bonfire_ui_common,bonfire_valueflows_observe,bonfire_epics,bonfire_notify,bonfire_ui_coordination,bonfire_data_edges,bonfire_extension_template,bonfire_open_id,bonfire_ui_kanban"
# bonfire_upcycle,bonfire_publisher_thesis,bonfire_ui_reflow,bonfire_data_tasks,bonfire_taxonomy_seeder,bonfire_encryption_backend,bonfire_pages,bonfire_web_phoenix,bonfire_website
2021-12-12 02:53:51 +00:00
# -
# name: Get branch names
# id: branch-name
# uses: tj-actions/branch-names@v4
-
name: Set up QEMU
uses: docker/setup-qemu-action@v1
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
-
name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Cancel any already running releases workflows
uses: styfle/cancel-workflow-action@0.9.0
with:
access_token: ${{ github.token }}
-
name: Pre-build prep
2022-05-23 02:52:36 +00:00
run: sudo apt-get install -y cargo && cargo install just && echo "/github/home/.cargo/bin" >> $GITHUB_PATH && just rel-prepare
2021-12-12 02:53:51 +00:00
-
name: Build and push
id: docker_build
uses: docker/build-push-action@v2
env:
FLAVOUR: classic
FLAVOUR_PATH: data/current_flavour
with:
context: .
file: Dockerfile.release
2022-03-09 03:23:32 +00:00
# platforms: linux/amd64
2022-07-21 09:41:41 +00:00
# platforms: linux/amd64,linux/arm64
platforms: linux/amd64,linux/arm64,linux/arm/v7
2021-12-12 02:53:51 +00:00
push: true
tags: |
bonfirenetworks/${{ env.DOCKER_REPO }}:latest-${{ env.FLAVOUR }}
bonfirenetworks/${{ env.DOCKER_REPO }}:${{steps.version.outputs.current-version}}-${{ env.FLAVOUR }}
-
name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}
2022-06-14 09:56:00 +00:00
# FIXME: tried running this separately with the same Docker tag to not slow down the release (currently about 10 min for x86, 40 min for x86+arm64, and several hours if you add armv7), but putting this as a separate task overwrites the image pushed to docker hub by the first one
2021-09-26 02:42:31 +00:00
2022-06-14 09:56:00 +00:00
classic_flavour_common_docker_release_build_push_x86:
2023-01-30 06:37:29 +00:00
name: Classic flavour for x86 - release Docker image
2021-06-16 19:25:54 +00:00
runs-on: ubuntu-latest
env:
2022-06-14 09:56:00 +00:00
FLAVOUR: classic
FLAVOUR_PATH: flavours/classic
2022-01-25 19:46:45 +00:00
DOCKER_REPO: bonfire
2021-04-20 13:07:54 +00:00
steps:
2021-05-01 12:46:38 +00:00
-
name: Checkout
2021-04-20 13:07:54 +00:00
uses: actions/checkout@v2
2021-05-01 12:38:16 +00:00
with:
fetch-depth: 2 # needed for action-detect-and-tag-new-version
2021-05-01 12:46:38 +00:00
-
2022-09-08 02:50:23 +00:00
name: Detect new version
2021-05-01 12:34:45 +00:00
id: version
uses: salsify/action-detect-and-tag-new-version@v2
with:
2022-06-14 09:59:08 +00:00
create-tag: false # tag already created in first job
2021-05-01 12:34:45 +00:00
version-command: |
2021-05-16 15:46:08 +00:00
grep -m 1 'version:' mix.exs | cut -d '"' -f2
2022-06-14 09:59:08 +00:00
# -
# if: steps.version.outputs.current-version == steps.version.outputs.previous-version
# name: Cancel workflow if the version has not changed
# uses: andymckay/cancel-action@0.2
2022-06-14 09:56:00 +00:00
# -
# name: Get branch names
# id: branch-name
# uses: tj-actions/branch-names@v4
2021-04-20 13:07:54 +00:00
-
name: Set up QEMU
uses: docker/setup-qemu-action@v1
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
-
name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
2022-06-14 09:59:08 +00:00
# -
# name: Cancel any already running releases workflows
# uses: styfle/cancel-workflow-action@0.9.0
# with:
# access_token: ${{ github.token }}
2021-04-20 13:07:54 +00:00
-
name: Pre-build prep
2022-05-23 02:52:36 +00:00
run: sudo apt-get install -y cargo && cargo install just && echo "/github/home/.cargo/bin" >> $GITHUB_PATH && just rel-prepare
2021-04-20 13:07:54 +00:00
-
name: Build and push
id: docker_build
uses: docker/build-push-action@v2
2021-05-05 12:03:43 +00:00
env:
2022-06-14 09:56:00 +00:00
FLAVOUR: classic
2021-06-17 10:46:47 +00:00
FLAVOUR_PATH: data/current_flavour
2021-04-20 13:07:54 +00:00
with:
context: .
file: Dockerfile.release
2022-06-14 09:56:00 +00:00
platforms: linux/amd64
# platforms: linux/amd64,linux/arm64
# platforms: linux/amd64,linux/arm64,linux/arm/v7
2021-04-20 13:07:54 +00:00
push: true
2021-05-01 13:03:47 +00:00
tags: |
2022-06-14 09:56:00 +00:00
bonfirenetworks/${{ env.DOCKER_REPO }}:latest-${{ env.FLAVOUR }}-x86
bonfirenetworks/${{ env.DOCKER_REPO }}:${{steps.version.outputs.current-version}}-${{ env.FLAVOUR }}-x86
2021-04-20 13:07:54 +00:00
-
name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}
2022-01-25 19:46:45 +00:00
2023-01-30 06:37:29 +00:00
classic_flavour_common_docker_release_build_push_arm:
name: Classic flavour for ARM - release Docker image
runs-on: ubuntu-latest
env:
FLAVOUR: classic
FLAVOUR_PATH: flavours/classic
DOCKER_REPO: bonfire
steps:
-
name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 2 # needed for action-detect-and-tag-new-version
-
name: Detect new version
id: version
uses: salsify/action-detect-and-tag-new-version@v2
with:
create-tag: false # tag already created in first job
version-command: |
grep -m 1 'version:' mix.exs | cut -d '"' -f2
# -
# if: steps.version.outputs.current-version == steps.version.outputs.previous-version
# name: Cancel workflow if the version has not changed
# uses: andymckay/cancel-action@0.2
# -
# name: Get branch names
# id: branch-name
# uses: tj-actions/branch-names@v4
-
name: Set up QEMU
uses: docker/setup-qemu-action@v1
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
-
name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
# -
# name: Cancel any already running releases workflows
# uses: styfle/cancel-workflow-action@0.9.0
# with:
# access_token: ${{ github.token }}
-
name: Pre-build prep
run: sudo apt-get install -y cargo && cargo install just && echo "/github/home/.cargo/bin" >> $GITHUB_PATH && just rel-prepare
-
name: Build and push
id: docker_build
uses: docker/build-push-action@v2
env:
FLAVOUR: classic
FLAVOUR_PATH: data/current_flavour
with:
context: .
file: Dockerfile.release
platforms: linux/arm64
# platforms: linux/amd64,linux/arm64
# platforms: linux/amd64,linux/arm64,linux/arm/v7
push: true
tags: |
bonfirenetworks/${{ env.DOCKER_REPO }}:latest-${{ env.FLAVOUR }}-aarch64
bonfirenetworks/${{ env.DOCKER_REPO }}:${{steps.version.outputs.current-version}}-${{ env.FLAVOUR }}-x86
-
name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}
2022-06-14 09:56:00 +00:00
cooperation_flavour_docker_release_build_push:
2022-07-21 09:41:41 +00:00
name: Cooperation flavour - multiarch - Maybe release Docker image
2022-03-29 22:02:21 +00:00
runs-on: ubuntu-latest
env:
2022-06-14 09:56:00 +00:00
FLAVOUR: cooperation
FLAVOUR_PATH: flavours/cooperation
DOCKER_REPO: bonfire
2022-03-29 22:02:21 +00:00
steps:
-
name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 2 # needed for action-detect-and-tag-new-version
-
2022-09-08 02:50:23 +00:00
name: Detect new version
2022-03-29 22:02:21 +00:00
id: version
uses: salsify/action-detect-and-tag-new-version@v2
with:
create-tag: false # tag already created in first job
version-command: |
grep -m 1 'version:' mix.exs | cut -d '"' -f2
-
name: Set up QEMU
uses: docker/setup-qemu-action@v1
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
-
name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Pre-build prep
2022-05-23 02:52:36 +00:00
run: sudo apt-get install -y cargo && cargo install just && echo "/github/home/.cargo/bin" >> $GITHUB_PATH && just rel-prepare
2022-03-29 22:02:21 +00:00
-
name: Build and push
id: docker_build
uses: docker/build-push-action@v2
env:
2022-06-14 09:56:00 +00:00
FLAVOUR: cooperation
2022-03-29 22:02:21 +00:00
FLAVOUR_PATH: data/current_flavour
with:
context: .
file: Dockerfile.release
2022-07-19 22:09:45 +00:00
platforms: linux/amd64,linux/arm64,linux/arm/v7
2022-03-29 22:02:21 +00:00
push: true
tags: |
2022-06-14 09:56:00 +00:00
bonfirenetworks/${{ env.DOCKER_REPO }}:latest-${{ env.FLAVOUR }}
bonfirenetworks/${{ env.DOCKER_REPO }}:${{steps.version.outputs.current-version}}-${{ env.FLAVOUR }}
2022-03-29 22:02:21 +00:00
-
name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}
2022-06-14 09:56:00 +00:00
# reflow_flavour_docker_release_build_push:
# name: Reflow flavour - Maybe release Docker image
# runs-on: ubuntu-latest
# env:
# FLAVOUR: reflow
# FLAVOUR_PATH: flavours/reflow
# DOCKER_REPO: reflow
# APP_NAME: reflow
# steps:
# -
# name: Checkout
# uses: actions/checkout@v2
# with:
# fetch-depth: 2 # needed for action-detect-and-tag-new-version
# -
# name: Detect version
# id: version
# uses: salsify/action-detect-and-tag-new-version@v2
# with:
# create-tag: false # tag already created in first job
# version-command: |
# grep -m 1 'version:' mix.exs | cut -d '"' -f2
# -
# name: Set up QEMU
# uses: docker/setup-qemu-action@v1
# -
# name: Set up Docker Buildx
# uses: docker/setup-buildx-action@v1
# -
# name: Login to DockerHub
# uses: docker/login-action@v1
# with:
# username: ${{ secrets.DOCKERHUB_USERNAME }}
# password: ${{ secrets.DOCKERHUB_TOKEN }}
# -
# name: Pre-build prep
# run: sudo apt-get install -y cargo && cargo install just && echo "/github/home/.cargo/bin" >> $GITHUB_PATH && just rel-prepare
# -
# name: Build and push
# id: docker_build
# uses: docker/build-push-action@v2
# env:
# FLAVOUR: reflow
# FLAVOUR_PATH: data/current_flavour
# with:
# context: .
# file: Dockerfile.release
# platforms: linux/amd64 #,linux/arm64
# push: true
# tags: |
# bonfirenetworks/${{ env.DOCKER_REPO }}:latest
# bonfirenetworks/${{ env.DOCKER_REPO }}:${{steps.version.outputs.current-version}}
# -
# name: Image digest
# run: echo ${{ steps.docker_build.outputs.digest }}