Skip to content

Commit bf4109a

Browse files
committed
LICENSE badge
1 parent 5a91869 commit bf4109a

File tree

1 file changed

+89
-62
lines changed

1 file changed

+89
-62
lines changed

.github/workflows/release.yml

Lines changed: 89 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -1,79 +1,106 @@
1-
name: Bump version and publish
1+
#name: Bump version and publish
2+
#
3+
#on:
4+
# workflow_run:
5+
# workflows: [ "CI" ]
6+
# types: [ completed ]
7+
#
8+
#jobs:
9+
# tag:
10+
# permissions:
11+
# contents: write
12+
#
13+
# if: >
14+
# github.event.workflow_run.conclusion == 'success' &&
15+
# github.event.workflow_run.head_branch == 'main'
16+
# runs-on: ubuntu-latest
17+
#
18+
# outputs:
19+
# tag: ${{ steps.tag_version.outputs.new_tag }}
20+
#
21+
# steps:
22+
# - uses: actions/checkout@v4
23+
#
24+
# - name: Bump version and tag
25+
# id: tag_version
26+
# uses: mathieudutour/github-tag-action@v6.2
27+
# with:
28+
# github_token: ${{ secrets.GITHUB_TOKEN }}
29+
#
30+
# - name: Create GitHub release
31+
# uses: softprops/action-gh-release@v2
32+
# with:
33+
# tag_name: ${{ steps.tag_version.outputs.new_tag }}
34+
# generate_release_notes: true
35+
#
36+
# build:
37+
# needs: tag
38+
# runs-on: ubuntu-latest
39+
# steps:
40+
# - uses: actions/checkout@v4
41+
#
42+
# - name: Setup Python
43+
# uses: actions/setup-python@v5
44+
# with:
45+
# python-version: '3.12'
46+
#
47+
# - name: Install hatch
48+
# run: |
49+
# pip install hatch
50+
#
51+
# - name: Build package
52+
# run: |
53+
# sed -i "s/0.0.0/${{ needs.tag.outputs.tag }}/" pyproject.toml
54+
# # Constructs the dist folder
55+
# hatch build
56+
#
57+
# - uses: actions/upload-artifact@v4
58+
# with:
59+
# name: dist
60+
# path: dist
61+
#
62+
#
63+
# publish:
64+
# needs: build
65+
# runs-on: ubuntu-latest
66+
# environment: release
67+
#
68+
# permissions:
69+
# # This permission is required for trusted publishing.
70+
# id-token: write
71+
#
72+
# steps:
73+
# - uses: actions/download-artifact@v4
74+
# with:
75+
# name: dist
76+
# path: dist
77+
#
78+
# - name: Publish to PyPI
79+
# uses: pypa/gh-action-pypi-publish@release/v1
80+
81+
82+
# .github/workflows/release.yml
83+
name: Release
284

385
on:
486
workflow_run:
587
workflows: [ "CI" ]
688
types: [ completed ]
789

890
jobs:
9-
tag:
10-
permissions:
11-
contents: write
12-
91+
release:
1392
if: >
1493
github.event.workflow_run.conclusion == 'success' &&
1594
github.event.workflow_run.head_branch == 'main'
16-
runs-on: ubuntu-latest
17-
18-
outputs:
19-
tag: ${{ steps.tag_version.outputs.new_tag }}
20-
21-
steps:
22-
- uses: actions/checkout@v4
23-
24-
- name: Bump version and tag
25-
id: tag_version
26-
uses: mathieudutour/github-tag-action@v6.2
27-
with:
28-
github_token: ${{ secrets.GITHUB_TOKEN }}
2995
30-
- name: Create GitHub release
31-
uses: softprops/action-gh-release@v2
32-
with:
33-
tag_name: ${{ steps.tag_version.outputs.new_tag }}
34-
generate_release_notes: true
35-
36-
build:
37-
needs: tag
3896
runs-on: ubuntu-latest
39-
steps:
40-
- uses: actions/checkout@v4
41-
42-
- name: Setup Python
43-
uses: actions/setup-python@v5
44-
with:
45-
python-version: '3.12'
46-
47-
- name: Install hatch
48-
run: |
49-
pip install hatch
50-
51-
- name: Build package
52-
run: |
53-
sed -i "s/0.0.0/${{ needs.tag.outputs.tag }}/" pyproject.toml
54-
# Constructs the dist folder
55-
hatch build
56-
57-
- uses: actions/upload-artifact@v4
58-
with:
59-
name: dist
60-
path: dist
61-
62-
63-
publish:
64-
needs: build
65-
runs-on: ubuntu-latest
66-
environment: release
6797

6898
permissions:
69-
# This permission is required for trusted publishing.
70-
id-token: write
99+
contents: write
100+
id-token: write # For trusted publishing
71101

72102
steps:
73-
- uses: actions/download-artifact@v4
103+
- uses: cvxgrp/.github/actions/release@main
74104
with:
75-
name: dist
76-
path: dist
77-
78-
- name: Publish to PyPI
79-
uses: pypa/gh-action-pypi-publish@release/v1
105+
python-version: '3.12' # Optional, defaults to 3.12
106+
build-tool: 'hatch' # Optional, defaults to hatch

0 commit comments

Comments
 (0)