Skip to content

Commit

Permalink
testing release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
mobileoverlord committed Jun 28, 2024
1 parent 670d914 commit 03ae18b
Show file tree
Hide file tree
Showing 6 changed files with 94 additions and 4 deletions.
83 changes: 83 additions & 0 deletions .github/workflows/build_push_release_arm64.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
name: Build and Push Release

on:
push:
tags:
- 'v*'

permissions:
contents: write

jobs:
create_release:
runs-on: ubuntu-latest-4-cores-arm64

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Set Env
run: |
VERSION=$(echo "${GITHUB_REF#refs/*/}" | sed 's/^v//')
echo "RELEASE_TAG=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
echo "RELEASE_VERSION=${VERSION}" >> $GITHUB_ENV
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
with:
install: true

- name: Build release artifacts for arm64
run: |
docker buildx build --platform linux/arm64/v8 --output type=local,dest=docker_output/ -t peridiod:${RELEASE_TAG} -f support/Containerfile-release.arm64 .
- name: Create GitHub Release
id: create_release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release create $RELEASE_TAG \
--title $RELEASE_TAG \
--notes "$(awk "/## $RELEASE_TAG/{flag=1;next}/##/{flag=0}flag" CHANGELOG.md)"
- name: Upload Release Asset
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
mv ./docker_output/arm64/peridiod-${RELEASE_VERSION}.tar.gz ./docker_output/peridiod-${RELEASE_VERSION}-arm64.tar.gz
gh release upload $RELEASE_TAG ./docker_output/peridiod-${RELEASE_VERSION}-arm64.tar.gz --clobber
- name: Load docker hub credentials
id: op-load-docker-hub-credentials
uses: 1password/load-secrets-action@v1
with:
export-env: false
env:
OP_SERVICE_ACCOUNT_TOKEN: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }}
DOCKER_HUB_USERNAME: op://ci-cd/docker-hub-machine/username
DOCKER_HUB_PASSWORD: op://ci-cd/docker-hub-machine/password

- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ steps.op-load-docker-hub-credentials.outputs.DOCKER_HUB_USERNAME }}
password: ${{ steps.op-load-docker-hub-credentials.outputs.DOCKER_HUB_PASSWORD }}

- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
file: ./Containerfile
platforms: linux/arm64/v8
push: true
tags: |
peridio/peridiod:$RELEASE_VERSION
peridio/peridiod:latest
- name: Image digest
id: image_digest
uses: docker/metadata-action@v5
with:
images: peridio/peridiod

- name: Output image digest
run: echo ${{ steps.image_digest.outputs.digest }}
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# peridiod releases

## 2.5.4-dev

* Enhancements
* Here is an enhancement
* Bug Fixes
* Here is a bug fix

## v2.5.3

* Bug fixes
Expand Down
2 changes: 1 addition & 1 deletion Containerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM elixir:1.16.2-alpine AS build
FROM elixir:1.16.3-alpine AS build

ARG MIX_ENV=prod
ARG UBOOT_ENV_SIZE=0x20000
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.5.3
2.5.4-dev
2 changes: 1 addition & 1 deletion support/Containerfile-release.amd64
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM --platform=linux/amd64 hexpm/elixir:1.16.2-erlang-26.2.5-ubuntu-noble-20240429 AS build
FROM --platform=linux/amd64 hexpm/elixir:1.16.3-erlang-26.2.5.1-ubuntu-noble-20240605 AS build

ARG MIX_ENV=prod
ARG UBOOT_ENV_SIZE=0x20000
Expand Down
2 changes: 1 addition & 1 deletion support/Containerfile-release.arm64
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM --platform=linux/arm64/v8 hexpm/elixir:1.16.2-erlang-26.2.5-ubuntu-noble-20240429 AS build
FROM --platform=linux/arm64/v8 hexpm/elixir:1.16.3-erlang-26.2.5.1-ubuntu-noble-20240605 AS build

ARG MIX_ENV=prod
ARG UBOOT_ENV_SIZE=0x20000
Expand Down

0 comments on commit 03ae18b

Please sign in to comment.