Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release/workflow test #1748

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 60 additions & 0 deletions .github/workflows/do_release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: Draft release

on:
push:
branches:
- next

jobs:
create_release:
name: Create release
if: startsWith(github.head_ref , 'release/')
# we could check for tags but
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Get the version tag
id: version_tag
run: |
echo tag_name=${GITHUB_REF#refs/tags/} >> $GITHUB_OUTPUT
- name: Get latest release tag
id: latest_release
run: |
LATEST_RELEASE_TAG=$(curl --silent "https://api.github.com/repos/${GITHUB_REPOSITORY}/releases/latest" \
| jq -r .tag_name)
echo "Latest release tag is $LATEST_RELEASE_TAG"
echo "::set-output name=tag::$LATEST_RELEASE_TAG"
shell: bash
- name: Get release branch name
id: release_branch_name
run: |
echo RELEASE_BRANCH_NAME="${RELEASE_NAME=${GITHUB_HEAD_REF#release/}}" >> $GITHUB_OUTPUT
- name: Replace underscores and capitalize
id: release_title
run: |
TITLE=${{steps.release_branch_name.outputs.RELEASE_BRANCH_NAME}}
TITLE=${TITLE//_/ } # Replace underscores with spaces
TITLE=${TITLE//-/ } # Replace dash with spaces
TITLE=${TITLE^^} # Capitalize the first letter
echo title=$TITLE >> $GITHUB_OUTPUT
- name: Create release
id: create_release
run: |
gh release edit ${{steps.version_tag.outputs.tag_name}}
--title="${{steps.version_tag.outputs.tag_name}} ${{steps.release_title.outputs.title}}" \
--draft=false
rebase_main:
name: Rebase main
needs: create_release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Rebase main
run: |
git checkout next
git pull
git checkout main
git rebase next
git push --tags


4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,10 @@
"preview": "vite preview",
"test": "vitest run ./src/components/**/*.spec.jsx",
"link-parser": "rm -rf node_modules/@laboratoria/curriculum-parser && ln -s ../../../curriculum-parser node_modules/@laboratoria/",
"link-react": "rm -rf node_modules/@laboratoria/react && ln -s ../../../react node_modules/@laboratoria/"
"link-react": "rm -rf node_modules/@laboratoria/react && ln -s ../../../react node_modules/@laboratoria/",
"preversion": "npm test",
"version": "rm -rf dist && npm run build:content && git add -A dist",
"postversion": "echo 'post versioning should do git push and git push --tags'"
},
"dependencies": {
"@emotion/react": "^11.11.3",
Expand Down
Loading