docs: improved readme #95
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Merge with main branch | |
on: | |
pull_request: | |
types: [closed] | |
branches: | |
- main | |
jobs: | |
main-pr-merge: | |
if: github.event.pull_request.merged == true | |
permissions: write-all | |
runs-on: ubuntu-latest | |
outputs: | |
release_created: ${{ steps.release_action_plan.outputs.releases_created }} | |
matrix: ${{ steps.create-matrix.outputs.matrix }} | |
steps: | |
- name: Checkout our repository | |
uses: actions/checkout@v2 | |
with: | |
ref: main | |
- name: Configure Git | |
run: | | |
git config user.name "$GITHUB_ACTOR" | |
git config user.email "[email protected]" | |
- name: Release Please | |
id: release_action_plan | |
uses: googleapis/release-please-action@v4 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
config-file: .github/configuration/release-please-config.json | |
manifest-file: .github/configuration/release-please-manifest.json | |
include-component-in-tag: true | |
target-branch: main | |
- name: Create matrix for release | |
id: create-matrix | |
uses: actions/github-script@v5 | |
with: | |
script: | | |
const allOutputs = ${{toJson(steps.release_action_plan.outputs)}}; | |
console.log("all outputs",allOutputs); | |
const pathsReleased = JSON.parse('${{ steps.release_action_plan.outputs.paths_released }}'); | |
console.log("pathsReleased",pathsReleased); | |
let includeArray = pathsReleased.map(path => { | |
const tag_name = allOutputs[`${path}--tag_name`]; | |
return { path, tag_name }; | |
}); | |
core.setOutput('matrix', JSON.stringify({ include: includeArray })); | |
#TODO: fix the path and add publish. The only release that needs to be skipped is website | |
release-matrix: | |
runs-on: ubuntu-latest | |
needs: main-pr-merge | |
permissions: | |
contents: read | |
packages: write | |
id-token: write | |
if: needs.main-pr-merge.outputs.release_created == 'true' | |
strategy: | |
matrix: ${{ fromJson(needs.main-pr-merge.outputs.matrix) }} | |
steps: | |
- name: Checkout our repository | |
uses: actions/checkout@v2 | |
with: | |
ref: main | |
fetch-depth: 0 | |
# todo: the below three steps are not required use github artifact to transfer the build between workflows :) but doing it as of now for alpha releases | |
- name: Install python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.12" | |
- uses: Gr1N/setup-poetry@v8 | |
with: | |
poetry-version: "1.8.3" | |
# - name: Build poetry | |
# working-directory: ${{ matrix.path }} | |
# run: poetry build -f wheel | |
# - name: Publish package distributions to PyPI | |
# uses: pypa/gh-action-pypi-publish@release/v1 | |
# with: | |
# packages-dir: ${{ matrix.path }}/dist | |