diff --git a/.github/workflows/lsp-release.yml b/.github/workflows/lsp-release.yml new file mode 100644 index 000000000..59fe49184 --- /dev/null +++ b/.github/workflows/lsp-release.yml @@ -0,0 +1,67 @@ +name: 'Release: esbonio' +on: + push: + branches: + - release + paths: + - 'lib/esbonio/**' + +jobs: + release: + name: esbonio release + runs-on: ubuntu-latest + environment: + name: pypi + url: https://pypi.org/p/esbonio + permissions: + contents: write + id-token: write + + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-python@v4 + with: + python-version: "3.10" + + - run: | + + sudo apt update + sudo apt install pandoc + + python --version + python -m pip install --upgrade pip + python -m pip install --upgrade tox bump2version towncrier docutils + name: Setup Environment + + - run: | + set -e + + ./scripts/make-release.sh lsp + name: Set Version + id: info + + - name: Package + run: | + cd lib/esbonio + python -m tox -e pkg + + - name: 'Upload Artifact' + uses: actions/upload-artifact@v3 + with: + name: 'dist' + path: lib/esbonio/dist + + - name: Publish + uses: pypa/gh-action-pypi-publish@release/v1 + with: + packages-dir: lib/esbonio/dist/ + + - name: Create Release + run: | + gh release create "${RELEASE_TAG}" \ + --title "Esbonio Language Server v${VERSION} - ${RELEASE_DATE}" \ + -F lib/esbonio/.changes.html \ + ./lib/esbonio/dist/* + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index 8b83abe3d..000000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,225 +0,0 @@ -name: Release -on: - push: - branches: - - release - -jobs: - # Simple job the checks to see which parts we actually have to build. - trigger: - name: Trigger - runs-on: ubuntu-latest - outputs: - docs: ${{steps.check-docs.outputs.build}} - extensions: ${{steps.check-extensions.outputs.build}} - lsp: ${{steps.check-lsp.outputs.build}} - vscode: ${{steps.check-vscode.outputs.build}} - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - run: | - if [ -z "${BASE_REF}" ]; then - echo "BASE=HEAD^" >> $GITHUB_ENV - else - echo "BASE=origin/${BASE_REF}" >> $GITHUB_ENV - fi - name: Determine base - env: - BASE_REF: ${{ github.base_ref }} - - - id: check-vscode - run: | - set -e - echo ${BASE} - - ./scripts/should-build.sh vscode - name: "Build VSCode?" - - - id: check-extensions - run: | - set -e - echo ${BASE} - - ./scripts/should-build.sh extensions - name: "Build Extensions?" - - - id: check-lsp - run: | - set -e - echo ${BASE} - - ./scripts/should-build.sh lsp - name: "Build LSP?" - - vscode: - name: VSCode Extension - needs: [trigger, extensions] - if: always() && needs.trigger.outputs.vscode - runs-on: ubuntu-latest - steps: - - uses: 'actions/checkout@v4' - - - uses: 'actions/setup-node@v3' - with: - node-version: 16.x - - - uses: 'actions/setup-python@v4' - with: - python-version: "3.10" - - - run: | - sudo apt update - sudo apt install pandoc - - python --version - python -m pip install --upgrade pip - python -m pip install --upgrade tox bump2version towncrier docutils - name: Install Build Tools - - - run: | - set -e - - ./scripts/make-release.sh vscode - name: Set Version - id: info - - - run: | - cd code - npm ci - npm run package - name: Package Extension - - - name: 'Upload Artifact' - uses: actions/upload-artifact@v3 - with: - name: 'vsix' - path: code/*.vsix - - - name: 'Publish Extension' - run: | - cd code - npm run deploy - env: - VSCE_PAT: ${{ secrets.VSCODE_PAT }} - - - name: Create Release - run: | - gh release create "${RELEASE_TAG}" \ - --title "Esbonio VSCode Extension v${VERSION} - ${RELEASE_DATE}" \ - -F code/.changes.html \ - ./code/*.vsix - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - extensions: - name: "Sphinx Extensions" - needs: [trigger, lsp] - if: always() && needs.trigger.outputs.extensions - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - - uses: actions/setup-python@v4 - with: - python-version: "3.10" - - - run: | - sudo apt update - sudo apt install pandoc - - python --version - python -m pip install --upgrade pip - python -m pip install --upgrade tox bump2version towncrier docutils - name: Setup Environment - - - run: | - set -e - - ./scripts/make-release.sh extensions - name: Set Version - id: info - - - name: Package - run: | - cd lib/esbonio-extensions - python -m tox -e pkg - - - name: 'Upload Artifact' - uses: actions/upload-artifact@v3 - with: - name: 'dist' - path: lib/esbonio-extensions/dist - - - name: Publish - id: assets - run: | - cd lib/esbonio-extensions - python -m pip install twine - python -m twine upload dist/* -u alcarney -p ${{ secrets.PYPI_PASS }} - - - name: Create Release - run: | - gh release create "${RELEASE_TAG}" \ - --title "Esbonio Extensions v${VERSION} - ${RELEASE_DATE}" \ - -F lib/esbonio-extensions/.changes.html \ - ./lib/esbonio-extensions/dist/* - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - lsp: - name: Language Server - needs: trigger - if: always() && needs.trigger.outputs.lsp - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v4 - - - uses: actions/setup-python@v4 - with: - python-version: "3.10" - - - run: | - - sudo apt update - sudo apt install pandoc - - python --version - python -m pip install --upgrade pip - python -m pip install --upgrade tox bump2version towncrier docutils - name: Setup Environment - - - run: | - set -e - - ./scripts/make-release.sh lsp - name: Set Version - id: info - - - name: Package - run: | - cd lib/esbonio - python -m tox -e pkg - - - name: 'Upload Artifact' - uses: actions/upload-artifact@v3 - with: - name: 'dist' - path: lib/esbonio/dist - - - name: Publish - run: | - cd lib/esbonio - python -m pip install twine - python -m twine upload dist/* -u alcarney -p ${{ secrets.PYPI_PASS }} - - - name: Create Release - run: | - gh release create "${RELEASE_TAG}" \ - --title "Esbonio Language Server v${VERSION} - ${RELEASE_DATE}" \ - -F lib/esbonio/.changes.html \ - ./lib/esbonio/dist/* - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/sphinx-ext-release.yml b/.github/workflows/sphinx-ext-release.yml new file mode 100644 index 000000000..d8e83f047 --- /dev/null +++ b/.github/workflows/sphinx-ext-release.yml @@ -0,0 +1,66 @@ +name: 'Release: esbonio-extensions' +on: + push: + branches: + - release + paths: + - 'lib/esbonio-extensions/**' + +jobs: + release: + name: "esbonio-extensions release" + runs-on: ubuntu-latest + environment: + name: pypi + url: https://pypi.org/p/esbonio-extensions + permissions: + contents: write + id-token: write + + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-python@v4 + with: + python-version: "3.10" + + - run: | + sudo apt update + sudo apt install pandoc + + python --version + python -m pip install --upgrade pip + python -m pip install --upgrade tox bump2version towncrier docutils + name: Setup Environment + + - run: | + set -e + + ./scripts/make-release.sh extensions + name: Set Version + id: info + + - name: Package + run: | + cd lib/esbonio-extensions + python -m tox -e pkg + + - name: 'Upload Artifact' + uses: actions/upload-artifact@v3 + with: + name: 'dist' + path: lib/esbonio-extensions/dist + + - name: Publish + uses: pypa/gh-action-pypi-publish@release/v1 + with: + packages-dir: lib/esbonio-extensions/dist/ + + - name: Create Release + run: | + gh release create "${RELEASE_TAG}" \ + --title "Esbonio Extensions v${VERSION} - ${RELEASE_DATE}" \ + -F lib/esbonio-extensions/.changes.html \ + ./lib/esbonio-extensions/dist/* + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/vscode-release.yml b/.github/workflows/vscode-release.yml new file mode 100644 index 000000000..2caaeea74 --- /dev/null +++ b/.github/workflows/vscode-release.yml @@ -0,0 +1,66 @@ +name: 'Release: vscode-extension' +on: + push: + branches: + - release + paths: + - 'code/**' + +jobs: + vscode: + name: 'vscode extension release' + runs-on: ubuntu-latest + steps: + - uses: 'actions/checkout@v4' + + - uses: 'actions/setup-node@v3' + with: + node-version: 16.x + + - uses: 'actions/setup-python@v4' + with: + python-version: "3.10" + + - run: | + sudo apt update + sudo apt install pandoc + + python --version + python -m pip install --upgrade pip + python -m pip install --upgrade tox bump2version towncrier docutils + name: Install Build Tools + + - run: | + set -e + + ./scripts/make-release.sh vscode + name: Set Version + id: info + + - run: | + cd code + npm ci + npm run package + name: Package Extension + + - name: 'Upload Artifact' + uses: actions/upload-artifact@v3 + with: + name: 'vsix' + path: code/*.vsix + + - name: 'Publish Extension' + run: | + cd code + npm run deploy + env: + VSCE_PAT: ${{ secrets.VSCODE_PAT }} + + - name: Create Release + run: | + gh release create "${RELEASE_TAG}" \ + --title "Esbonio VSCode Extension v${VERSION} - ${RELEASE_DATE}" \ + -F code/.changes.html \ + ./code/*.vsix + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/scripts/make-release.sh b/scripts/make-release.sh index f761cf61c..768a67225 100755 --- a/scripts/make-release.sh +++ b/scripts/make-release.sh @@ -112,8 +112,8 @@ if [ "${GITHUB_REF}" = "refs/heads/release" ]; then python -m towncrier build --yes --version="${VERSION}" # Setup git, commit, tag and push all the changes. - git config user.email "41898282+github-actions[bot]@users.noreply.github.com" - git config user.name "github-actions[bot]" + git config user.name github-actions + git config user.email github-actions@github.com git commit -am "${COMMIT_MSG}${VERSION}"