Skip to content

Commit

Permalink
Merge pull request #15 from omnisat/test
Browse files Browse the repository at this point in the history
add python
  • Loading branch information
hathbanger authored Oct 12, 2024
2 parents 4e5482f + 69b4b5b commit 4c1b14e
Showing 1 changed file with 12 additions and 141 deletions.
153 changes: 12 additions & 141 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-depth: 0 # Ensure full history is checked out

- name: Setup Node.js
uses: actions/setup-node@v4
Expand All @@ -29,6 +29,17 @@ jobs:
- name: Install dependencies
run: pnpm install

# Setup Python and install openai module
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.x'

- name: Install Python dependencies
run: |
python3 -m pip install --upgrade pip
pip install openai
- name: Generate git diff
run: |
if [ "$(git rev-parse --is-shallow-repository)" = "true" ]; then
Expand All @@ -55,143 +66,3 @@ jobs:
git push
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

changeset-rc-version:
runs-on: ubuntu-latest
needs: generate-release-notes
if: github.ref == 'refs/heads/dev'
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20

- name: Setup pnpm
uses: pnpm/action-setup@v2
with:
version: 8.6.6

- name: Install dependencies
run: pnpm install

# Run Changesets version for RC
- name: Run Changesets pre-release mode for RC
run: |
pnpx changeset pre enter rc # Enter RC mode
pnpx changeset version # Bump RC version
# Commit the version bump and changelog
- name: Commit version bumps and changelog
run: |
git add .
git commit -m "RC version bump"
git push
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

publish-rc-release:
runs-on: ubuntu-latest
needs: changeset-rc-version
if: github.ref == 'refs/heads/dev'
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20

- name: Setup pnpm
uses: pnpm/action-setup@v2
with:
version: 8.6.6

- name: Install dependencies
run: pnpm install

# Publish the RC version to npm (or another registry)
- name: Publish RC to npm
run: pnpm publish --tag rc --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

changeset-stable-version:
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main'
needs: publish-rc-release
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20

- name: Setup pnpm
uses: pnpm/action-setup@v2
with:
version: 8.6.6

- name: Install dependencies
run: pnpm install

# Exit pre-release mode
- name: Exit RC mode
run: pnpx changeset pre exit

# Run Changesets version to bump versions and generate changelogs for stable release
- name: Run Changesets version
run: pnpx changeset version

# Commit the version bump and changelog
- name: Commit version bumps and changelog
run: |
git add .
git commit -m "Stable version bump"
git push
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

publish-stable-release:
runs-on: ubuntu-latest
needs: changeset-stable-version
if: github.ref == 'refs/heads/main'
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20

- name: Setup pnpm
uses: pnpm/action-setup@v2
with:
version: 8.6.6

- name: Install dependencies
run: pnpm install

# Publish the stable version to npm
- name: Publish stable release to npm
run: pnpm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

# Create a GitHub Release with the summarized release notes
- name: Create GitHub Release
uses: actions/create-release@v1
with:
tag_name: ${{ github.sha }}
release_name: "Stable Release ${{ github.sha }}"
body_path: releases/main_summary_notes_$(date +'%Y-%m-%d').md
draft: false
prerelease: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 4c1b14e

Please sign in to comment.