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

(CD TEST, please ignore) #49

Merged
merged 10 commits into from
Jul 10, 2024
Merged
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
26 changes: 17 additions & 9 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
name: Release

on:
push:
branches: [ main ]
pull_request_target:
branches: [ main, test-main ]
types: [ closed ]

jobs:
changelog:
Expand All @@ -12,6 +13,7 @@ jobs:
uses: ./.github/workflows/test.yml

release:
if: github.event.pull_request.merged == true
needs: [ changelog, test ]
runs-on: ubuntu-latest
steps:
Expand All @@ -30,24 +32,30 @@ jobs:
git config user.name "Open Terms Archive Release Bot"
git config user.email "[email protected]"
git commit --message="Update changelog" CHANGELOG.md package.json package-lock.json
git push origin
git rev-parse v${{ steps.update-changelog.outputs.version }}-changelog-action-test || git tag v${{ steps.update-changelog.outputs.version }}-changelog-action-test

- name: Tag commit
if: needs.changelog.outputs.release-type != 'no-release'
run: |
git tag v${{ steps.update-changelog.outputs.version }}
git push origin --tags
- name: Run status checks for release commit on temporary branch # Use temporary branch to enable pushing commits to this branch protected by required status checks
uses: CasperWA/push-protected@v2
with:
token: ${{ secrets.RELEASE_BOT_GITHUB_TOKEN }}
branch: test-main
tags: true
interval: 10 # seconds between checks
pre_sleep: 15
fail_fast: true

- name: Publish to NPM public repository
if: needs.changelog.outputs.release-type != 'no-release'
uses: JS-DevTools/npm-publish@v3
with:
token: ${{ secrets.NPMJS_ACCESS_TOKEN }}
tag: changelog-action-test
dry-run: true

- name: Create GitHub release
if: needs.changelog.outputs.release-type != 'no-release'
uses: softprops/action-gh-release@v2
with:
tag_name: v${{ steps.update-changelog.outputs.version }}
tag_name: v${{ steps.update-changelog.outputs.version }}-changelog-action-test
body: ${{ steps.update-changelog.outputs.content }}
token: ${{ secrets.GITHUB_TOKEN }}
6 changes: 2 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,9 @@ name: Validate document types

on:
push:
branches-ignore: [ main ] # will be called from workflow call
pull_request:
types: [ opened, reopened ]
branches-ignore: [ main, test-main ] # will be called from workflow call
workflow_call:

jobs:
validate:
runs-on: ubuntu-latest
Expand Down
4 changes: 0 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,6 @@ All changes that impact users of this module are documented in this file, in the
- Use [@OpenTermsArchive/changelog-action](https://github.com/OpenTermsArchive/changelog-action/) in CI/CD
- Decrease package size to half

## Unreleased [no-release]

_Modifications made in this changeset do not add, remove or alter any behavior, dependency, API or functionality of the software. They only change non-functional parts of the repository, such as the README file or CI workflows._

## 1.1.0 - 2023-10-25

### Added
Expand Down