Skip to content

Commit

Permalink
ci: separate workflows
Browse files Browse the repository at this point in the history
Release-As: 0.1.0-rc.14
Signed-off-by: Bowen Tan <bowentan78@gmail.com>
  • Loading branch information
bowentan committed Oct 13, 2022
1 parent efca590 commit 3a5ff64
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 29 deletions.
32 changes: 3 additions & 29 deletions .github/workflows/build-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ name: Build and publish
# documentation.

on:
push:
branches:
- main
release:
types:
- released

env:
# Use docker.io for Docker Hub if empty
Expand All @@ -17,33 +17,7 @@ env:
IMAGE_NAME: ${{ github.repository }}

jobs:
release-please:
runs-on: ubuntu-latest
steps:
- uses: google-github-actions/release-please-action@v3
id: release
with:
release-type: python
signoff: Bowen Tan <bowentan78@gmail.com>
prerelease: true
- uses: actions/checkout@v2
- name: tag major and minor versions
if: ${{ steps.release.outputs.release_created }}
run: |
git config user.name github-actions[bot]
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
git remote add gh-token "https://${{ secrets.GITHUB_TOKEN }}@github.com/google-github-actions/release-please-action.git"
git tag -d v${{ steps.release.outputs.major }} || true
git tag -d v${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }} || true
git push origin :v${{ steps.release.outputs.major }} || true
git push origin :v${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }} || true
git tag -a v${{ steps.release.outputs.major }} -m "Release v${{ steps.release.outputs.major }}"
git tag -a v${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }} -m "Release v${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }}"
git push origin v${{ steps.release.outputs.major }}
git push origin v${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }}
python-package-publish:
needs: release-please
permissions:
contents: read
runs-on: ubuntu-latest
Expand Down
32 changes: 32 additions & 0 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Release Release

on:
push:
branches:
- main

jobs:
release-please:
runs-on: ubuntu-latest
steps:
- uses: google-github-actions/release-please-action@v3
id: release
with:
release-type: python
signoff: Bowen Tan <bowentan78@gmail.com>
prerelease: true
- uses: actions/checkout@v2
- name: tag major and minor versions
if: ${{ steps.release.outputs.release_created }}
run: |
git config user.name github-actions[bot]
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
git remote add gh-token "https://${{ secrets.GITHUB_TOKEN }}@github.com/google-github-actions/release-please-action.git"
git tag -d v${{ steps.release.outputs.major }} || true
git tag -d v${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }} || true
git push origin :v${{ steps.release.outputs.major }} || true
git push origin :v${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }} || true
git tag -a v${{ steps.release.outputs.major }} -m "Release v${{ steps.release.outputs.major }}"
git tag -a v${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }} -m "Release v${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }}"
git push origin v${{ steps.release.outputs.major }}
git push origin v${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }}

0 comments on commit 3a5ff64

Please sign in to comment.