Release 📦🚀 #1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Release Pipeline | |
run-name: Release 📦🚀 | |
on: | |
workflow_dispatch: | |
branches: | |
- "main" | |
jobs: | |
CD: | |
runs-on: ubuntu-latest | |
steps: | |
- run: echo "🎉 The job was automatically triggered by a ${{ github.event_name }} event." | |
- run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by GitHub!" | |
- run: echo "🔎 The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}." | |
- name: Check out repository code | |
uses: actions/checkout@v4 | |
- run: echo "💡 The ${{ github.repository }} repository has been cloned to the runner." | |
- run: echo "🖥️ The workflow is now ready to test your code on the runner." | |
- name: Installing Devbox ⚙️ | |
uses: jetpack-io/[email protected] | |
- name: Install all dependencies 📦 | |
run: devbox run install | |
- name: Tag Name | |
run: export TAG_NAME="0.1.$(date +%s)" && echo "🏷️ Tag name is $TAG_NAME" | |
- name: Create Tag | |
uses: actions/github-script@v7 | |
with: | |
script: | | |
github.rest.git.createRef({ | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
ref: 'refs/tags/$TAG_NAME', | |
sha: context.sha | |
}) | |
- name: Create Release | |
uses: actions/github-script@v7 | |
with: | |
script: | | |
github.rest.repos.createRelease({ | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
tag_name: '$TAG_NAME', | |
name: 'Release $TAG_NAME', | |
generate_release_notes: true | |
}) | |
- name: 📦 Package | |
run: devbox run build | |
- name: 🚀 Publish to PyPI | |
run: devbox run publish | |
env: | |
TWINE_USERNAME: "__token__" | |
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }} | |
- run: echo "🍏 This job's status is ${{ job.status }}." |