From e9830261f479dcae2d20441c5998a14ca2c68f04 Mon Sep 17 00:00:00 2001 From: Guillaume Fraux Date: Tue, 15 Oct 2024 14:58:49 +0200 Subject: [PATCH 1/2] Update actions used in CI --- .github/workflows/tests.yml | 10 ++++------ .github/workflows/website.yml | 15 ++++++++------- .github/workflows/wheel.yml | 11 ++++++----- 3 files changed, 18 insertions(+), 18 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index c8e758585..ab11391e3 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -34,24 +34,22 @@ jobs: matrix: python-version: ['3.9', '3.12'] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 # we need the full history to be able to get the chemiscope version with # git describe during the build with: fetch-depth: 0 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} - - uses: actions/setup-node@v3 + - uses: actions/setup-node@v4 with: node-version: '22.x' cache: 'npm' - name: configure access to git repositories in package-lock.json run: git config --global url."https://github.com/".insteadOf ssh://git@github.com - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install tox==4.14.0 + run: python3 -m pip install tox - name: Run Python tests run: tox diff --git a/.github/workflows/website.yml b/.github/workflows/website.yml index 1c65cc66a..9182ffe90 100644 --- a/.github/workflows/website.yml +++ b/.github/workflows/website.yml @@ -8,18 +8,20 @@ on: jobs: build-website: + permissions: + contents: write runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 # we need the full history to be able to get the chemiscope version with # git describe during the build with: fetch-depth: 0 - - uses: actions/setup-node@v3 + - uses: actions/setup-node@v4 with: node-version: '22.x' cache: 'npm' - - uses: actions/setup-python@v4 + - uses: actions/setup-python@v5 with: python-version: '3.11' - name: configure access to git repositories in package-lock.json @@ -27,8 +29,7 @@ jobs: - name: install npm dependencies run: npm ci - name: install python dependencies - run: | - python3 -m pip install tox==4.14.0 + run: python3 -m pip install tox - run: npm run build - run: npm run download-examples - run: tox -e docs @@ -43,7 +44,7 @@ jobs: - name: deploy website to gh-pages # only deploy website from main branch if: github.ref == 'refs/heads/main' - uses: peaceiris/actions-gh-pages@v3 + uses: peaceiris/actions-gh-pages@v4 with: github_token: ${{ secrets.GITHUB_TOKEN }} publish_dir: ./gh-pages/ @@ -53,7 +54,7 @@ jobs: - name: upload minified JS to GitHub release # only upload minified JS from tags if: startsWith(github.ref, 'refs/tags/') - uses: softprops/action-gh-release@v1 + uses: softprops/action-gh-release@v2 with: files: | dist/chemiscope.d.ts diff --git a/.github/workflows/wheel.yml b/.github/workflows/wheel.yml index e0a6ef28c..6b59574ff 100644 --- a/.github/workflows/wheel.yml +++ b/.github/workflows/wheel.yml @@ -3,24 +3,25 @@ name: Build Python wheel on: push: branches: [main] - tags: '*' + tags: ['v*'] pull_request: # Check all PR jobs: build-wheels: + permissions: + contents: write runs-on: ubuntu-20.04 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: fetch-depth: 0 - - name: Set up Python - uses: actions/setup-python@v4 + - uses: actions/setup-python@v5 with: python-version: '3.11' - - uses: actions/setup-node@v3 + - uses: actions/setup-node@v4 with: node-version: 20.x From a20296053d6aa1c8acf9a738a4d454faffea3994 Mon Sep 17 00:00:00 2001 From: Guillaume Fraux Date: Tue, 15 Oct 2024 14:59:19 +0200 Subject: [PATCH 2/2] Upload wheels to releases in CI --- .github/workflows/wheel.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.github/workflows/wheel.yml b/.github/workflows/wheel.yml index 6b59574ff..eaddeb0b5 100644 --- a/.github/workflows/wheel.yml +++ b/.github/workflows/wheel.yml @@ -37,3 +37,13 @@ jobs: path: | dist/*.tar.gz dist/*.whl + + - name: upload wheel & sdist to GitHub release + if: startsWith(github.ref, 'refs/tags/') + uses: softprops/action-gh-release@v2 + with: + files: | + dist/*.tar.gz + dist/*.whl + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}