Skip to content

Commit

Permalink
ci: add noop release check
Browse files Browse the repository at this point in the history
  • Loading branch information
vicentebolea committed Aug 26, 2024
1 parent 78936dc commit 7b7ac19
Show file tree
Hide file tree
Showing 5 changed files with 109 additions and 54 deletions.
22 changes: 22 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,25 @@ jobs:
pip install -e '.[dev]'
- name: Invoke PyTest
run: pytest -v .

semantic_release:
runs-on: ubuntu-latest
name: Semantic release noop
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Python 3.10
uses: actions/setup-python@v5
with:
python-version: "3.10"

- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools wheel "build<0.10.0" python-semantic-release
- name: Python Semantic Release
id: release
uses: python-semantic-release/[email protected]
with:
root_options: -vv --noop
11 changes: 0 additions & 11 deletions .github/workflows/create_release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,3 @@ jobs:
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ steps.release.outputs.tag }}

- name: Merge release back to main
run: |
git config user.email "[email protected]"
git config user.name "github-actions"
sudo chown -R "${USER:-$(id -un)}" .
git fetch
git checkout main
git pull
git merge --no-ff release -m "Auto-merge release back to main"
git push
43 changes: 0 additions & 43 deletions .github/workflows/push_to_release.yaml

This file was deleted.

61 changes: 61 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: Create Release

on:
workflow_dispatch:
push:
branches:
- release

jobs:
release:
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/project/nrtk-explorer/
permissions:
id-token: write
contents: write

steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Set up Python 3.10
uses: actions/setup-python@v5
with:
python-version: "3.10"

- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools wheel "build<0.10.0" python-semantic-release
- name: Python Semantic Release
id: release
uses: python-semantic-release/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}

- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
if: steps.release.outputs.released == 'true'
with:
password: ${{ secrets.PYPI_API_TOKEN }}

- name: Publish package distributions to GitHub Releases
uses: python-semantic-release/upload-to-gh-release@main
if: steps.release.outputs.released == 'true'
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ steps.release.outputs.tag }}

- name: Merge release back to main
run: |
git config user.email "[email protected]"
git config user.name "github-actions"
sudo chown -R "${USER:-$(id -un)}" .
git fetch
git checkout main
git pull
git merge --no-ff release -m "Auto-merge release back to main"
git push
26 changes: 26 additions & 0 deletions .github/workflows/sync_branches.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Sync release branch to main

on:
push:
branches:
- release

jobs:
release:
runs-on: ubuntu-latest
permissions:
id-token: write
contents: write

steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Merge release -> main
uses: devmasx/merge-branch@master
with:
type: now
target_branch: main
message: Merge release into main
github_token: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 7b7ac19

Please sign in to comment.