Skip to content

Commit

Permalink
Try to configure actions
Browse files Browse the repository at this point in the history
Update CI.yml

Update CI.yml

Update CI.yml

Update CI.yml

Update CI.yml

Update CI.yml

Update CI.yml

Update CI.yml

Update CI.yml

Update CI.yml

Update pyproject.toml

Update CI.yml

Update CI.yml
  • Loading branch information
baseplate-admin committed Oct 30, 2024
1 parent c6aabfd commit e0fa87e
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 31 deletions.
88 changes: 58 additions & 30 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ permissions:
pull-requests: write

jobs:
'test-frontend':
name: Test Frontend
'build-frontend':
name: Build Frontend
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
Expand All @@ -23,15 +23,36 @@ jobs:
- name: Build
run: npm run build

- name: Test
run: npm run test
# Upload the entire workspace
- name: Upload entire workspace
uses: actions/upload-artifact@v4
with:
name: workspace
path: .
# retention-days: 1
'test-frontend':
name: Test Frontend
needs: ['build-frontend']

runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v4
# Download the entire workspace
- name: Download workspace
uses: actions/download-artifact@v4
with:
name: workspace
path: .

- name: Install Node.JS
uses: actions/setup-node@v4

- name: Install dependencies
run: npm ci

- name: Test
run: npm run test

'test-backend':
runs-on: ubuntu-latest
Expand Down Expand Up @@ -107,42 +128,49 @@ jobs:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}

release:
name: Release
if: "startsWith(github.ref, 'refs/tags/')"
runs-on: ubuntu-latest
needs: ['test-backend', 'test-frontend']

steps:
- name: Checkout Repo
uses: actions/checkout@v4

# Download the entire workspace
- name: Download workspace
uses: actions/download-artifact@v4
with:
name: workspace
path: .
if: "startsWith(github.ref, 'refs/tags/')"
needs: ['test-frontend', 'test-backend']

- name: Install Python
uses: actions/setup-python@v5
with:
python-version: 3.13
environment:
name: pypi
url: https://pypi.org/project/django-hstore-widget

permissions:
contents: write
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
steps:
- uses: actions/checkout@v4
- name: Install Poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: true
virtualenvs-in-project: true
# Download the entire workspace
- name: Download workspace
uses: actions/download-artifact@v4
with:
name: workspace
path: .

# - name: Install python dependencies
# run: |
# poetry install --sync --no-interaction --no-root

- name: Set pypi token
- name: Install python dependencies
run: |
poetry config pypi-token.pypi ${{ secrets.PYPI_TOKEN }}
# Upload the .whl file to the GitHub Release
- name: Publish
run: |
poetry publish --build
- name: Build the dependency
run: poetry build --output py-dist

- name: Upload package to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: py-dist/*
tag: ${{ github.ref }}
overwrite: true
file_glob: true

- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: py-dist/
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "django-hstore-widget"
version = "0.0.9"
version = "0.0.10"
description = "Human friendly HStoreWidget. Continual of django-admin-hstore-widget."
authors = [
"Alexandre Dufour <[email protected]>",
Expand Down

0 comments on commit e0fa87e

Please sign in to comment.