-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ae5776e
commit 12e20b8
Showing
10 changed files
with
359 additions
and
9 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
name: create branch | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
version: | ||
required: true | ||
type: string | ||
description: The version of the release | ||
|
||
jobs: | ||
branch: | ||
runs-on: ubuntu-latest | ||
env: | ||
BRANCH: releases/${{ inputs.version }} | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: setup git config | ||
run: | | ||
git config user.name "GitHub Action" | ||
git config user.email "github-action@users.noreply.github.com" | ||
- name: guarantee branch doesn't exist | ||
run: | | ||
if git ls-remote --exit-code --heads origin ${BRANCH} ; then | ||
exit 1 | ||
else | ||
exit 0 | ||
fi | ||
- name: install dependencies | ||
run: | | ||
npm install --no-bin-links | ||
- name: build | ||
run: npm run build | ||
|
||
- name: create branch | ||
run: | | ||
git checkout -b ${BRANCH} | ||
git push origin ${BRANCH} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
name: create release | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
branch: | ||
required: true | ||
type: string | ||
description: The branch to release | ||
version: | ||
required: true | ||
type: string | ||
description: The version of the release | ||
body: | ||
required: true | ||
type: string | ||
description: The body of the release | ||
prerelease: | ||
required: false | ||
default: false | ||
type: boolean | ||
description: Whether the release is a prerelease | ||
|
||
jobs: | ||
release: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- uses: ncipollo/release-action@a2e71bdd4e7dab70ca26a852f29600c98b33153e # v1.12.0 | ||
with: | ||
name: ${{ inputs.version }} | ||
tag: ${{ inputs.version }} | ||
body: ${{ inputs.body }} | ||
commit: ${{ github.ref }} | ||
prerelease: ${{ inputs.prerelease == 'prereleased' }} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
name: extract changelog | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
changelogPath: | ||
required: true | ||
type: string | ||
description: The path to the changelog | ||
outputs: | ||
version: | ||
description: The latest version in the changelog | ||
value: ${{ jobs.extract.outputs.version }} | ||
body: | ||
description: The body of the changelog | ||
value: ${{ jobs.extract.outputs.body }} | ||
prerelease: | ||
description: Whether the version is in prerelease | ||
value: ${{ jobs.extract.outputs.prerelease }} | ||
|
||
jobs: | ||
extract: | ||
outputs: | ||
version: ${{ steps.changelog.outputs.version }} | ||
body: ${{ steps.changelog.outputs.changes }} | ||
prerelease: ${{ steps.changelog.outputs.status == 'prereleased' }} | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: read changelog | ||
id: changelog | ||
uses: mindsers/changelog-reader-action@b97ce03a10d9bdbb07beb491c76a5a01d78cd3ef # v2.2.2 | ||
with: | ||
path: ${{ inputs.changelogPath }} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
name: nightly release | ||
|
||
on: | ||
workflow_call: | ||
|
||
jobs: | ||
releaseDate: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
date: ${{steps.releaseDate.outputs.date}} | ||
steps: | ||
- name: output current date | ||
id: releaseDate | ||
run: echo "date=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT | ||
switchBranch: | ||
uses: ./.github/workflows/switch_js_branch.yaml | ||
with: | ||
version: nightly | ||
createRelease: | ||
needs: [releaseDate, switchBranch] | ||
permissions: | ||
contents: write | ||
uses: ./.github/workflows/create_release.yaml | ||
with: | ||
branch: releases/nightly | ||
version: nightly-${{needs.releaseDate.outputs.date}} | ||
body: | | ||
Nightly Build | ||
Version: nightly-${{needs.releaseDate.outputs.date}} | ||
Release Date: ${{needs.releaseDate.outputs.date}} | ||
This nightly build is generated from the main branch of the repository and is not intended for testing purposes. It includes incremental changes since the last nightly build. | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
name: release # for releasing action-release-workflow project | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
paths: | ||
- CHANGELOG.md | ||
workflow_dispatch: | ||
|
||
jobs: | ||
changelog: | ||
uses: ./.github/workflows/extract_changelog.yaml | ||
with: | ||
changelogPath: ./CHANGELOG.md | ||
checkVersion: | ||
needs: changelog | ||
runs-on: ubuntu-latest | ||
outputs: | ||
exists: ${{ steps.tag-exists.outputs.exists }} | ||
steps: | ||
- name: check if tag exists | ||
uses: mukunku/tag-exists-action@5dfe2bf779fe5259360bb10b2041676713dcc8a3 # v1.1.0 | ||
id: tag-exists | ||
with: | ||
tag: ${{ needs.changelog.outputs.version }} | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
createRelease: | ||
needs: [checkVersion, changelog] | ||
permissions: | ||
contents: write | ||
if: needs.checkVersion.outputs.exists == 'false' | ||
uses: ./.github/workflows/create_release.yaml | ||
with: | ||
branch: ${{ github.ref }} | ||
version: ${{ needs.changelog.outputs.version }} | ||
body: ${{ needs.changelog.outputs.body }} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
name: release project | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
changelogPath: | ||
required: true | ||
type: string | ||
description: The path to CHANGELOG.md | ||
|
||
jobs: | ||
extractChangelog: | ||
uses: ./.github/workflows/extract_changelog.yaml | ||
with: | ||
changelogPath: ${{inputs.changelogPath}} | ||
checkVersion: | ||
needs: extractChangelog | ||
runs-on: ubuntu-latest | ||
outputs: | ||
exists: ${{ steps.tag-exists.outputs.exists }} | ||
steps: | ||
- name: check if tag exists | ||
uses: mukunku/tag-exists-action@5dfe2bf779fe5259360bb10b2041676713dcc8a3 # v1.1.0 | ||
id: tag-exists | ||
with: | ||
tag: ${{ needs.extractChangelog.outputs.version }} | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
createBranch: | ||
needs: [extractChangelog, checkVersion] | ||
if: needs.checkVersion.outputs.exists == 'false' | ||
uses: ./.github/workflows/create_js_branch.yaml | ||
with: | ||
version: ${{ needs.extractChangelog.outputs.version }} | ||
createRelease: | ||
needs: [checkVersion, extractChangelog] | ||
permissions: | ||
contents: write | ||
if: needs.checkVersion.outputs.exists == 'false' | ||
uses: ./.github/workflows/create_release.yaml | ||
with: | ||
branch: release/${{ needs.extractChangelog.outputs.version }} | ||
version: ${{ needs.extractChangelog.outputs.version }} | ||
body: ${{ needs.extractChangelog.outputs.body }} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
name: switch branch # switches to `releases/nightly` branch or creates it if it doesn't exist | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
version: | ||
required: true | ||
type: string | ||
description: The version of the release | ||
|
||
jobs: | ||
branch: | ||
runs-on: ubuntu-latest | ||
env: | ||
BRANCH: releases/${{ inputs.version }} | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: setup git config | ||
run: | | ||
git config user.name "GitHub Action" | ||
git config user.email "github-action@users.noreply.github.com" | ||
- name: install dependencies | ||
run: | | ||
npm install --no-bin-links | ||
- name: build | ||
run: npm run build | ||
|
||
- name: switch or create branch | ||
run: | | ||
if git ls-remote --exit-code --heads origin ${BRANCH} ; then | ||
git checkout ${BRANCH} | ||
git checkout -b tmp origin/main | ||
git merge -s ours ${BRANCH} | ||
git checkout ${BRANCH} | ||
git rm -r node_modules --ignore-unmatch | ||
git merge tmp | ||
git branch -D tmp | ||
git push origin ${BRANCH} | ||
else | ||
git checkout -b ${BRANCH} | ||
git push origin ${BRANCH} | ||
fi | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -396,3 +396,6 @@ FodyWeavers.xsd | |
|
||
# JetBrains Rider | ||
*.sln.iml | ||
|
||
# Mac Search | ||
.DS_Store |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# Change Log | ||
|
||
## [0.0.5] - 2023-06-07 | ||
- updated release_js_project and nightly_release workflows | ||
|
||
## [0.0.4] - 2023-06-07 | ||
- added nightly release workflow | ||
|
||
## [0.0.3] - 2023-05-16 | ||
|
||
### Added | ||
- input params used correctly | ||
|
||
## [0.0.2] - 2023-05-16 | ||
|
||
### Added | ||
- working version params? | ||
|
||
## [0.0.1] - 2023-04-28 | ||
|
||
### Added | ||
|
||
- Initial release of project | ||
- Adds create_js_branch, create_release, and extract_changelog workflows |
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