feat: add usage instructions #1
Workflow file for this run
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: google-github-actions/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 })); | |
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 | |
- name: Publish package distributions to PyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
packages-dir: unoplat-code-confluence/dist | |
- name: Publish package | |
working-directory: ${{ matrix.path }} | |
run: | | |
poetry publish --build-wheel | |