From 500adfe9ecc3ae19b8f5100c93e517bcf42f6df8 Mon Sep 17 00:00:00 2001 From: Michael Lynch Date: Sun, 10 Nov 2024 00:17:48 -0500 Subject: [PATCH] Complete the publish pipeline (#372) --- .circleci/config.yml | 38 +++++++++++++++++++++++++++++++++++--- 1 file changed, 35 insertions(+), 3 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 62141c31..1069f2dc 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -169,6 +169,29 @@ jobs: root: ./ paths: - ./dist + publish_release: + executor: base + environment: + GITHUB_TOKEN: "${GITHUB_TOKEN}" + steps: + - attach_workspace: + at: ./ + - run: + name: Install GitHub CLI + command: | + curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg + sudo chmod go+r /usr/share/keyrings/githubcli-archive-keyring.gpg + echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null + sudo apt update + sudo apt install gh + - run: + name: Create and upload release + command: | + gh release create "${CIRCLE_TAG}" ./dist/* \ + --repo "${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME}" \ + --title "${CIRCLE_TAG}" \ + --notes "Release ${CIRCLE_TAG}" \ + --verify-tag publish_docker_images: executor: base environment: @@ -254,7 +277,7 @@ workflows: filters: tags: only: /.*/ - - publish_docker_images: + - publish_release: requires: - check_whitespace - check_bash @@ -262,11 +285,20 @@ workflows: - test_go - lint_sql - build_backend + - package_release filters: + tags: + only: /[0-9]+(\.[0-9]+){2}/ branches: - only: master + ignore: /.*/ + - publish_docker_images: + requires: + - package_release + filters: tags: - only: /.*/ + only: /[0-9]+(\.[0-9]+){2}/ + branches: + ignore: /.*/ - deploy: requires: - check_whitespace