Skip to content

πŸ†™ Update node version for git runner #213

πŸ†™ Update node version for git runner

πŸ†™ Update node version for git runner #213

Workflow file for this run

---
name: Build package & publish
on:
push:
# Sequence of patterns matched against refs/heads
branches:
- '**' # Push events on all branchs
tags:
- v* # Push events with tags starting with v
jobs:
publish:
name: Build package
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: '18.x'
- name: Cache dependencies
uses: actions/cache@v1
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Install node requirements
run: npm ci
- name: 🚨 Check lint
run: |
npm run lint
npm run validate
- name: πŸ— Build html
run: make build-html
- name: πŸš€ Deploy to GitHub pages
if: startsWith(github.event.ref, 'refs/tags') || github.ref == 'refs/heads/master'
uses: peaceiris/actions-gh-pages@v3
with:
deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }}
publish_branch: gh-pages
publish_dir: ./__sapper__/export/muse
force_orphan: true
- name: 🐍 Build Python package
run: make build-python
#- name: Publish package πŸ“¦ to Test PyPI
# uses: pypa/gh-action-pypi-publish@master
# if: startsWith(github.event.ref, 'refs/tags')
# with:
# user: __token__
# password: ${{ secrets.test_pypi_password }}
# repository_url: https://test.pypi.org/legacy/
- name: Publish package πŸ“¦ to PyPI
uses: pypa/gh-action-pypi-publish@master
if: startsWith(github.event.ref, 'refs/tags')
with:
user: __token__
password: ${{ secrets.pypi_password }}
repository_url: https://upload.pypi.org/legacy/
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
if: startsWith(github.event.ref, 'refs/tags')
- name: 🐳 Set up Docker Buildx
uses: docker/setup-buildx-action@v1
if: startsWith(github.event.ref, 'refs/tags')
- name: Login to DockerHub
uses: docker/login-action@v1
if: startsWith(github.event.ref, 'refs/tags')
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_HUB_TOKEN }}
- name: Build and push docker image
uses: docker/build-push-action@v2
if: startsWith(github.event.ref, 'refs/tags')
with:
context: .
file: ./Dockerfile
push: true
platforms: linux/amd64,linux/arm64
tags: cristianpb/mopidy-muse:latest
target: prod
- name: 🍱 Upload package artifact
uses: actions/upload-artifact@v2
with:
name: Mopidy-Muse.zip
path: dist/Mopidy-Muse*.tar.gz
- name: ⬆ Upgrade package version files
if: startsWith(github.event.ref, 'refs/tags')
run: |
git config --global user.name 'Github Bot'
git config --global user.email 'bot@github.com'
git add package.json package-lock.json setup.cfg
git commit -m "⬆ Upgrade package version files"
git push origin HEAD:master
releasing:
name: Publish release
needs: publish
runs-on: ubuntu-latest
if: startsWith(github.event.ref, 'refs/tags')
steps:
- uses: actions/checkout@v2
- name: ⬇ Download artifact from build package job
uses: actions/download-artifact@v2
with:
name: Mopidy-Muse.zip
- name: πŸ”–Publish Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: false
- run: mv Mopidy-Muse*.tar.gz Mopidy-Muse.tar.gz
- name: 🍱 Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./Mopidy-Muse.tar.gz
asset_name: Mopidy-Muse.tar.gz
asset_content_type: application/gzip