generated from actions/typescript-action
-
Notifications
You must be signed in to change notification settings - Fork 2
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
f948d6b
commit dd470e0
Showing
2 changed files
with
57 additions
and
42 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 |
---|---|---|
@@ -1,15 +1,16 @@ | ||
name: Merge | ||
|
||
on: | ||
push: | ||
branches: [main] | ||
paths: | ||
- 'src/**' | ||
- 'package-lock.json' | ||
- 'package.json' | ||
- 'tsconfig.json' | ||
- 'action.yml' | ||
workflow_dispatch: | ||
# push: | ||
# branches: [main] | ||
# paths: | ||
# - 'src/**' | ||
# - 'package-lock.json' | ||
# - 'package.json' | ||
# - 'tsconfig.json' | ||
# - 'action.yml' | ||
# workflow_dispatch: | ||
pull_request: | ||
|
||
concurrency: | ||
group: ${{ github.workflow }} | ||
|
@@ -20,33 +21,46 @@ jobs: | |
name: Release | ||
env: | ||
TEMP_BRANCH: temp-${{ github.run_number }} | ||
outputs: | ||
tag: ${{ steps.changelog.outputs.tag }} | ||
# outputs: | ||
# tag: ${{ steps.changelog.outputs.tag }} | ||
permissions: | ||
contents: write | ||
runs-on: ubuntu-latest | ||
steps: | ||
|
||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Conventional Changelog Update | ||
uses: TriPSs/conventional-changelog-action@v5 | ||
id: changelog | ||
continue-on-error: true | ||
- id: tripteki | ||
uses: tripteki/[email protected] | ||
with: | ||
git-branch: ${{ env.TEMP_BRANCH }} | ||
github-token: ${{ github.token }} | ||
skip-version-file: 'true' | ||
skip-commit: 'true' | ||
skip-on-empty: 'true' | ||
git-push: 'false' | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
- shell: sh | ||
run: | | ||
echo ${{ steps.tripteki.outputs.exists }} | ||
echo ${{ steps.tripteki.outputs.version }} | ||
echo ${{ steps.tripteki.outputs.passes }} | ||
# - name: Conventional Changelog Update | ||
# uses: TriPSs/conventional-changelog-action@v5 | ||
# id: changelog | ||
# continue-on-error: false | ||
# with: | ||
# # git-branch: ${{ env.TEMP_BRANCH }} | ||
# github-token: ${{ github.token }} | ||
# skip-version-file: 'true' | ||
# skip-commit: 'true' | ||
# skip-on-empty: 'true' | ||
# git-push: 'false' | ||
|
||
- name: Rebuild, push and release | ||
if: ${{ steps.changelog.outputs.tag }} | ||
- name: Build and release | ||
# if: ${{ steps.changelog.outputs.tag }} | ||
env: | ||
GH_TOKEN: ${{ github.token }} | ||
TAG: ${{ steps.changelog.outputs.tag }} | ||
run: | | ||
set -x | ||
npm run dist | ||
git diff ./dist | ||
git checkout -b ${{ env.TEMP_BRANCH }} | ||
|
@@ -56,23 +70,23 @@ jobs: | |
git add . | ||
git commit -m "Rebuild dist/ directory" | ||
git push -u origin HEAD:${{ env.TEMP_BRANCH }} | ||
echo "Creating release ${{ steps.changelog.outputs.tag }}" | ||
git push origin tag ${{ steps.changelog.outputs.tag }} | ||
gh release create ${{ steps.changelog.outputs.tag }} --title ${{ steps.changelog.outputs.tag }} --generate-notes | ||
echo "Creating release ${{ env.TAG }}" | ||
git push origin tag ${{ env.TAG }} | ||
gh release create ${{ env.TAG }} --title ${{ env.TAG }} --generate-notes | ||
cleanup: | ||
name: Cleanup | ||
if: always() && ${{ needs.release.outputs.tag }} | ||
needs: release | ||
env: | ||
TEMP_BRANCH: temp-${{ github.run_number }} | ||
permissions: | ||
contents: write | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
# cleanup: | ||
# name: Cleanup | ||
# if: ${{ needs.release.outputs.tag }} | ||
# needs: release | ||
# env: | ||
# TEMP_BRANCH: temp-${{ github.run_number }} | ||
# permissions: | ||
# contents: write | ||
# runs-on: ubuntu-latest | ||
# steps: | ||
# - uses: actions/checkout@v4 | ||
# with: | ||
# fetch-depth: 0 | ||
|
||
- name: Cleanup | ||
run: git push --delete origin ${{ env.TEMP_BRANCH }} | ||
# - name: Cleanup | ||
# run: git push --delete origin ${{ env.TEMP_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 |
---|---|---|
@@ -1,6 +1,7 @@ | ||
name: PR | ||
on: | ||
pull_request: | ||
# pull_request: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
test: | ||
|