π set splitwise transaction date based on lunchmoney date (#87) #40
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: Release | |
on: | |
push: | |
branches: [main, next, beta, alpha, '*.x'] | |
jobs: | |
release: | |
name: Release | |
if: github.repository_owner == 'juftin' | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Setup Node.js | |
uses: actions/setup-node@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.10' | |
- name: Install Hatch | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install -q hatch | |
hatch -v env create | |
hatch --version | |
- name: Release | |
run: hatch run semantic-release | |
env: | |
GITHUB_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }} | |
GIT_AUTHOR_NAME: github-actions[bot] | |
GIT_AUTHOR_EMAIL: github-actions[bot]@users.noreply.github.com | |
GIT_COMMITTER_NAME: github-actions[bot] | |
GIT_COMMITTER_EMAIL: github-actions[bot]@users.noreply.github.com | |
github-pages-publish: | |
needs: release | |
if: github.ref == 'refs/heads/main' && github.repository_owner == 'juftin' | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Latest Changes | |
uses: actions/checkout@v3 | |
with: | |
path: ${{ github.workspace }}/main | |
ref: ${{ github.ref }} | |
fetch-depth: 0 | |
- name: Create gh-pages if not exists | |
working-directory: ${{ github.workspace }}/main | |
run: | | |
git checkout gh-pages || git checkout -b gh-pages | |
git push --set-upstream origin gh-pages || true | |
git checkout main -- | |
- name: Checkout gh-pages Branch | |
uses: actions/checkout@v3 | |
with: | |
path: ${{ github.workspace }}/github-pages | |
ref: gh-pages | |
fetch-depth: 0 | |
- name: Set up Python Environment | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.10' | |
- name: Install Hatch | |
working-directory: ${{ github.workspace }}/main | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install -q hatch | |
hatch -v env create | |
hatch --version | |
- name: Documentation Generation | |
working-directory: ${{ github.workspace }}/main | |
run: | | |
hatch run docs-build | |
- name: Setup Git Config | |
run: | | |
git config --global user.name "github-actions[bot]" | |
git config --global user.email "github-actions[bot]@users.noreply.github.com" | |
- name: Get Commit SHA from main | |
working-directory: ${{ github.workspace }}/main | |
run: | | |
COMMIT_SHA=$(git rev-parse HEAD) | |
PROJECT_VERSION=$(hatch version) | |
echo PROJECT_VERSION=${PROJECT_VERSION} >> $GITHUB_ENV | |
echo "COMMIT_SHA=${COMMIT_SHA}" >> ${GITHUB_ENV} | |
- name: Commit Changes to gh-pages Branch | |
working-directory: ${{ github.workspace }}/github-pages | |
run: | | |
git rm -rf . || true | |
cp -R ${{ github.workspace }}/main/docs/_build/html/* ${PWD} | |
touch .nojekyll | |
cp ${{ github.workspace }}/main/docs/README.md . | |
git add . | |
git diff-index --quiet HEAD || git commit -m "GitHub Pages - ${{ env.PROJECT_VERSION }} - ${{ env.COMMIT_SHA }}" | |
git push origin gh-pages --force |