diff --git a/.github/release-please.yml b/.github/release-please.yml new file mode 100644 index 0000000..656fd4d --- /dev/null +++ b/.github/release-please.yml @@ -0,0 +1,3 @@ +# config for release-please bot +primaryBranch: main +handleGHRelease: true diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 9c98377..2252e66 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -9,10 +9,10 @@ jobs: runs-on: ubuntu-latest environment: name: pypi - # url: https://pypi.org/p/qref - url: https://test.pypi.org/p/qref permissions: id-token: write # IMPORTANT: this permission is mandatory for trusted publishing + contents: write + pages: write steps: - uses: actions/checkout@v4 - name: Set up Python @@ -22,24 +22,32 @@ jobs: - name: Install pypa/build run: python -m pip install build --user - name: Setup poetry - uses: abatilo/actions-poetry@v2 + uses: abatilo/actions-poetry@v2.0.0 + with: + poetry-version: 1.8.3 + - name: Install the packages required + run: poetry install --with docs - name: Build the package - # run: poetry config pypi-token.pypi ${{ secrets.TWINE_PASSWORD }} - run: poetry config pypi-token.pypi ${{ secrets.TEST_TWINE_PASSWORD }} - - - - - name: Publish the package - run: poetry publish --build - ## Uncomment the below after IT trusted publisher pypi request has been submitted - # - name: Publish package distributions to PyPI - # uses: pypa/gh-action-pypi-publish@release/v1 + run: poetry build + - name: Publish package distributions to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + repository-url: https://test.pypi.org/legacy/ # TODO: change to https://upload.pypi.org/legacy/ after testing + - name: Install mike + run: poetry run mkdocs build + # https://github.com/jimporter/mike/blob/master/README.md#deploying-via-ci + - name: Configure git + run: | + git config user.name PsiQ-Qref + git config user.email qref-ci-bot@psiquantum.com - name: Build docs - run: mike deploy $RELEASE_VERSION latest --update-aliases + run: poetry run mike deploy $RELEASE_VERSION latest -u env: - RELEASE_VERSION: ${GITHUB_REF#refs/*/} # or #{{ github.ref }} - + RELEASE_VERSION: ${{ github.ref_name }} - name: Push docs - run: git push origin gh-pages:gh-pages + run: | + git pull -f origin gh-pages --rebase + git fetch origin gh-pages --depth=1 + git push -f origin gh-pages:gh-pages diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 0f5c5b7..88f1c2a 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -3,19 +3,19 @@ name: Release (Manual Trigger) on: workflow_dispatch: +permissions: + contents: write + pull-requests: write + jobs: - release-please: + release-please-pr-and-release: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - name: Increment version + - name: Increment version and create PR uses: googleapis/release-please-action@v4 with: token: ${{ secrets.GITHUB_TOKEN }} release-type: python skip-github-release: false skip-github-pull-request: true - -# bumps z in x.y.z if the commit message is: "fix: blah blah blah" (patch) -# bumps y in x.y.z if the commit message is: "feature: blah blah blah" (minor) -# bumps x in x.y.z if the commit message is "fix! or feature!: blah blah blah" (major) \ No newline at end of file diff --git a/.release-please-manifest.json b/.release-please-manifest.json new file mode 100644 index 0000000..8e6b7b2 --- /dev/null +++ b/.release-please-manifest.json @@ -0,0 +1,4 @@ +{ + ".": "0.1.13", + "skip-github-release": false +} \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..e69de29 diff --git a/pyproject.toml b/pyproject.toml index d231a6c..5a58666 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "qref" -version = "0.0.0" +version = "0.1.1" description = "Quantum Resource Estimation Format" authors = ["PsiQuantum, Corp."] license = "Apache 2.0"