Skip to content

Commit

Permalink
Handle tag releases
Browse files Browse the repository at this point in the history
  • Loading branch information
csandanov committed Dec 1, 2023
1 parent c7f7f5a commit 9cecd5f
Showing 1 changed file with 82 additions and 0 deletions.
82 changes: 82 additions & 0 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ on:
branches:
- '2.0'

tags:
- '*'

pull_request:

env:
Expand Down Expand Up @@ -72,6 +75,85 @@ jobs:
env:
DEST_DIR: wodby-cli/2.0/${{ matrix.os }}/${{ matrix.arch }}

release-aws-tagged:
runs-on: ubuntu-latest
needs: [build-test]
if: startsWith(github.ref, 'refs/tags/')
strategy:
matrix:
os: [ linux,darwin,windows ]
arch: [ amd64,arm64 ]
exclude:
- os: windows
arch: arm64
steps:
- name: set version from tag
if: startsWith(github.ref, 'refs/tags/')
run: echo "VERSION=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV
- name: 'Download Artifact'
uses: actions/download-artifact@v3
with:
name: dist-${{ matrix.os }}-${{ matrix.arch }}
path: dist
- name: release aws tagged
if: startsWith(github.ref, 'refs/tags/')
uses: jakejarvis/s3-sync-action@master
with:
args: --acl public-read --follow-symlinks --delete
env:
DEST_DIR: wodby-cli/$VERSION/${{ matrix.os }}/${{ matrix.arch }}

create-gh-release:
runs-on: ubuntu-latest
needs: [build-test]
if: startsWith(github.ref, 'refs/tags/')
steps:
- name: get the version from tag
id: version
if: startsWith(github.ref, 'refs/tags/')
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
- name: Create Release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.version.outputs.VERSION }}
release_name: ${{ steps.version.outputs.VERSION }}
draft: true
prerelease: false

upload-gh-release-artifacts:
runs-on: ubuntu-latest
needs: [create-gh-release]
if: startsWith(github.ref, 'refs/tags/')
strategy:
matrix:
os: [ linux,darwin,windows ]
arch: [ amd64,arm64 ]
exclude:
- os: windows
arch: arm64
steps:
- name: set version from tag
if: startsWith(github.ref, 'refs/tags/')
run: echo "VERSION=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV
- name: 'Download Artifact'
uses: actions/download-artifact@v3
with:
name: dist-${{ matrix.os }}-${{ matrix.arch }}
path: dist
- name: release github
if: startsWith(github.ref, 'refs/tags/')
uses: xresloader/upload-to-github-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
file: dist/wodby-*.tar.gz
overwrite: true
tags: true
draft: false
tag_name: ${{ env.VERSION }}

build-release-image:
runs-on: ubuntu-latest
steps:
Expand Down

0 comments on commit 9cecd5f

Please sign in to comment.