From 25fe81398a721169c0065fd752b3f34dd1af74b3 Mon Sep 17 00:00:00 2001 From: Justin Schneck Date: Thu, 27 Jun 2024 18:19:14 -0400 Subject: [PATCH] testing release workflow --- .github/workflows/build_push_release.yml | 79 ++++++++++++++++++++++++ CHANGELOG.md | 7 +++ VERSION | 2 +- 3 files changed, 87 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/build_push_release.yml diff --git a/.github/workflows/build_push_release.yml b/.github/workflows/build_push_release.yml new file mode 100644 index 0000000..1a1edef --- /dev/null +++ b/.github/workflows/build_push_release.yml @@ -0,0 +1,79 @@ +name: Build and Push Release + +on: + push: + tags: + - 'v*' + +permissions: + contents: write + +jobs: + create_release: + runs-on: ubuntu-latest + + 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 Docker image for amd64 + run: | + docker buildx build --platform linux/amd64 --output type=local,dest=docker_output/ -t peridiod:${RELEASE_TAG} -f support/Containerfile-release.amd64 . + + - 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: | + gh release upload ${{ github.ref }} ./docker_output/amd64/peridiod-${{ env.RELEASE_VERSION }}.tar.gz --clobber + + - name: Load docker hub credentials + id: op-load-docker-hub-credentials + uses: 1password/load-secrets-action@v1 + 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: . + platforms: linux/amd64,linux/arm64/v8 + push: true + tags: | + peridio/peridiod:${{ github.ref_name }} + 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 }} diff --git a/CHANGELOG.md b/CHANGELOG.md index f3b67bd..b341ea6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/VERSION b/VERSION index aedc15b..9cf22a4 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -2.5.3 +2.5.4-dev