From b82d35b02d799376abbc4cc9e23c59c6af3aaeb0 Mon Sep 17 00:00:00 2001 From: Phoeniix Zhao Date: Thu, 11 Jan 2024 21:59:01 +0800 Subject: [PATCH] ci: add a workflow to generate release Signed-off-by: Phoeniix Zhao --- .github/workflows/release.yml | 46 +++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..000c5417 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,46 @@ +name: release + +on: + push: + tags: + - "v*" + +env: + IMAGE_ID: ghcr.io/xline-kv/xline-operator + +jobs: + build: + name: Upload Release Asset + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest] + steps: + - name: Checkout code + uses: actions/checkout@v2 + with: + token: ${{ secrets.GH_TOKEN }} + submodules: recursive + - name: Build xline operator image + run: | + make docker-build IMG=${{ env.IMAGE_ID }}:${{ github.ref }} + - name: Login to GHCR + if: startsWith(matrix.job.platform, 'linux/') + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: xline-kv + password: ${{ secrets.GITHUB_TOKEN }} + - name: Push docker image to GHCR + run: | + make docker-push IMG=${{ env.IMAGE_ID }}:${{ github.ref }} + - name: Create Release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ github.ref }} + release_name: Release ${{ github.ref }} + draft: false + prerelease: false