Skip to content

Commit

Permalink
GHA test is done, release errors fixing now
Browse files Browse the repository at this point in the history
  • Loading branch information
mahiki committed Jul 22, 2024
1 parent b14e766 commit 70694b9
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 19 deletions.
11 changes: 6 additions & 5 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
name: Merge Release Branch and Tag

env:
ACTIONS_STEP_DEBUG: true
RELEASE_BRANCH: ${{ github.event.workflow_run.head_branch }}

on:
workflow_run:
workflows: [Test desertislandutils]
types: [completed]
branches:
- 'release/**'

env:
RELEASE_BRANCH: ${{ github.event.workflow_run.head_branch }}

jobs:
merge-and-tag:
runs-on: ubuntu-latest
Expand All @@ -20,8 +21,8 @@ jobs:
echo "head branch of trigger run: ${{ github.event.workflow_run.head_branch }}"
echo "shell RELEASE_BRANCH: $RELEASE_BRANCH"
- name: 'Checkout the whole repo'
uses: actions/checkout@v3
- name: Checkout the whole repo
uses: actions/checkout@v4
with:
fetch-depth: 0

Expand Down
36 changes: 22 additions & 14 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
name: Release desertislandutils
# create a release from the latest tag on MAIN or something

env:
ACTIONS_STEP_DEBUG: true

on:
workflow_run:
Expand All @@ -12,36 +16,40 @@ jobs:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: '3.11'

- run: python --version
- run: |
pipx install --python $(which python) poetry
poetry install
poetry show --latest
- name: Install Poetry
run: |
python --version
pipx install --python $(which python) poetry
poetry --version
poetry install
poetry show --latest
- name: Get latest tag
- run: |
- name: Get Gatest Tag
id: get_tag
run: |
git branch --list
git log --oneline --tags -n10 --pretty=format:'%h %as %cn %x09%s %d'
echo
echo "current ref is ${{ github.ref_name }}"
LATEST_TAG=$(git describe --tags `git rev-list --tags --max-count=1`)
echo "latest tag: $LATEST_TAG"
latest_tag="$(git describe --tags --abbrev=0)"
echo "latest tag: ${latest_tag}"
echo latest_tag="${latest_tag}" >> $GITHUB_OUTPUT
- name: Build poetry distribution
- name: Build Poetry Distribution from Latest Tag
run: |
git checkout $LATEST_TAG
git checkout ${{ steps.get_tag.outputs.latest_tag }}"
poetry build
- name: Create release from tag
uses: ncipollo/release-action@v1
with:
artifacts: "dist/*"
generateReleaseNotes: true
tag: $LATEST_TAG
tag: ${{ steps.get_tag.outputs.latest_tag }}
1 change: 1 addition & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ jobs:
run: |
python --version
pipx install --python $(which python) poetry
poetry --version
poetry install
poetry show --latest
Expand Down

0 comments on commit 70694b9

Please sign in to comment.