diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index f5552fa..5b87ba1 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -5,6 +5,9 @@ on: branches: - '2.0' + tags: + - '*' + pull_request: env: @@ -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: