Skip to content

Commit

Permalink
Tag the release only on alibaba/libvineyard.
Browse files Browse the repository at this point in the history
Signed-off-by: Tao He <linzhu.ht@alibaba-inc.com>
  • Loading branch information
sighingnow committed Nov 22, 2020
1 parent e4403cd commit f201976
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 19 deletions.
31 changes: 21 additions & 10 deletions .github/workflows/build-vineyardd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,25 @@ jobs:
sudo docker push docker.pkg.github.com/alibaba/libvineyard/vineyardd:alpine-latest
sudo docker push docker.pkg.github.com/alibaba/libvineyard/vineyardd:latest
- name: Upload wheels to latest release
- name: Extract tag name
id: tag
if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') }}
run: echo ::set-output name=TAG::${GITHUB_REF#refs/tags/}

- nam: Tag and upload docker for releases
if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') && github.repository == 'alibaba/libvineyard' }}
run: |
sudo docker tag docker.pkg.github.com/alibaba/libvineyard/vineyardd:alpine-${{ github.sha }} \
docker.pkg.github.com/alibaba/libvineyard/vineyardd:alpine-${{ steps.tag.outputs.TAG }}
sudo docker tag docker.pkg.github.com/alibaba/libvineyard/vineyardd:alpine-${{ github.sha }} \
docker.pkg.github.com/alibaba/libvineyard/vineyardd:${{ steps.tag.outputs.TAG }}
sudo docker push docker.pkg.github.com/alibaba/libvineyard/vineyardd:alpine-${{ steps.tag.outputs.TAG }}
sudo docker push docker.pkg.github.com/alibaba/libvineyard/vineyardd:${{ steps.tag.outputs.TAG }}
- name: Upload vineyardd to latest release
uses: svenstaro/upload-release-action@v2
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main'}}
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' && github.repository == 'alibaba/libvineyard' }}
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: vineyardd.${{ runner.os }}-generic.${{ github.sha }}.tar.gz
Expand All @@ -82,18 +98,13 @@ jobs:
overwrite: true
body: "prerelease for latest vineyard"

- name: Extract tag name
id: tag
if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') }}
run: echo ::set-output name=TAG::${GITHUB_REF#refs/tags/}

- name: Upload wheels to tagged release
- name: Upload vineyardd to tagged release
uses: svenstaro/upload-release-action@v2
if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') }}
if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') && github.repository == 'alibaba/libvineyard' }}
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: vineyardd.${{ runner.os }}-generic.${{ github.sha }}.tar.gz
asset_name: vineyardd-latest-linux_x86-64.tar.gz
asset_name: vineyardd-${{ steps.tag.outputs.TAG }}-linux_x86-64.tar.gz
tag: ${{ steps.tag.outputs.TAG }}
prerelease: false
overwrite: true
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/build-wheel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -214,9 +214,14 @@ jobs:
cat ./vineyard.pypi.${{ runner.os }}.${{ matrix.python }}.${{ github.sha }}.sha512sum
tar zcvfh vineyard.pypi.${{ runner.os }}.${{ matrix.python }}.${{ github.sha }}.tar.gz ./fixed_wheels vineyard.pypi.${{ runner.os }}.${{ matrix.python }}.${{ github.sha }}.sha512sum
- name: Extract tag name
id: tag
if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') }}
run: echo ::set-output name=TAG::${GITHUB_REF#refs/tags/}

- name: Upload wheels to latest release
uses: svenstaro/upload-release-action@v2
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main'}}
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' && github.repository == 'alibaba/libvineyard' }}
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: fixed_wheels/*.whl
Expand All @@ -226,14 +231,9 @@ jobs:
overwrite: true
body: "prerelease for latest vineyard"

- name: Extract tag name
id: tag
if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') }}
run: echo ::set-output name=TAG::${GITHUB_REF#refs/tags/}

- name: Upload wheels to tagged release
uses: svenstaro/upload-release-action@v2
if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') }}
if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') && github.repository == 'alibaba/libvineyard' }}
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: fixed_wheels/*.whl
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release-latest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,12 @@ jobs:

- name: Extract tag name
id: tag
if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') }}
if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') && github.repository == 'alibaba/libvineyard' }}
run: echo ::set-output name=TAG::${GITHUB_REF#refs/tags/}

- name: Cut a versioned release
uses: "marvinpinto/action-automatic-releases@latest"
if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') }}
if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') && github.repository == 'alibaba/libvineyard' }}
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: ${{ steps.tag.outputs.TAG }}
Expand Down

0 comments on commit f201976

Please sign in to comment.