Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 24 additions & 6 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,32 @@ name: Upload Python Package

on:
workflow_dispatch:
release:
types: [published]
push:
branches:
- v1

env:
IMAGE_NAME: cloudbees/launchable

jobs:
tagpr:
permissions:
actions: write
contents: write
pull-requests: write
runs-on: ubuntu-latest
outputs:
tag: ${{ steps.run-tagpr.outputs.tag }}
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- id: run-tagpr
uses: Songmu/tagpr@da82ed6743aec90049892070edd5561335904a9e # v1.17.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

pypi:
if: github.event_name != 'release' || startsWith(github.event.release.tag_name, 'v1')
needs: tagpr
if: needs.tagpr.outputs.tag != '' || github.event_name == 'workflow_dispatch'
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -50,9 +67,10 @@ jobs:
env:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
with:
args: "Launchable CLI ${{ github.event.release.tag_name }} is released! ${{ github.event.release.html_url }}"
args: "Launchable CLI ${{ needs.tagpr.outputs.tag }} is released! https://github.com/${{ github.repository }}/releases/tag/${{ needs.tagpr.outputs.tag }}"
docker:
if: github.event_name != 'release' || startsWith(github.event.release.tag_name, 'v1')
needs: tagpr
if: needs.tagpr.outputs.tag != '' || github.event_name == 'workflow_dispatch'
name: Push Docker image to Docker Hub
runs-on: ubuntu-22.04
permissions:
Expand Down Expand Up @@ -81,7 +99,7 @@ jobs:
file: ./Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ env.IMAGE_NAME }}:${{ github.event.release.tag_name }}
tags: ${{ env.IMAGE_NAME }}:${{ needs.tagpr.outputs.tag }}

- name: Generate artifact attestation
uses: actions/attest-build-provenance@e8998f949152b193b063cb0ec769d69d929409be # v2.4.0
Expand Down
1 change: 1 addition & 0 deletions .tagpr
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,4 @@
releaseBranch = v1
versionFile = -
changelog = false
fixedMajorVersion = v1
13 changes: 2 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,17 +44,8 @@ pipenv install --dev some-what-module

# How to release

1. Create a new tag for the next release locally

```sh
git checkout v1
git pull
git tag v1.xx.yy
git push origin --tags
```

2. Create new release on Github, then Github Actions automatically uploads the
module to PyPI.
[tagpr](https://github.com/Songmu/tagpr) creates a release pull request automatically when changes are pushed to the `v1` branch.
Merge the release pull request, then GitHub Actions automatically tags, creates a GitHub Release, and uploads the module to PyPI.

## How to update launchable/jar/exe_deploy.jar

Expand Down
Loading