Skip to content

Commit

Permalink
Repo improvements (#414)
Browse files Browse the repository at this point in the history
This PR will:

- Add new git workflows to the repository
- Added gulp tasks
- Updated cli scripts and devDependencies in use
  • Loading branch information
joselrio committed May 10, 2024
2 parents 06455a0 + 6ed91d8 commit b90b4d4
Show file tree
Hide file tree
Showing 18 changed files with 7,543 additions and 4,650 deletions.
2 changes: 1 addition & 1 deletion .github/os-git-actions/manual-commit/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ runs:
steps:
- name: Add new files (if needed)
shell: bash
if: ${{ inputs.newFiles }}
if: ${{ inputs.newFiles == 'true' }}
run: |
git add .
Expand Down
4 changes: 2 additions & 2 deletions .github/os-git-actions/signed-commit/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@ runs:
using: composite
steps:
- name: Setup GPG to sign commits
uses: ./.github/setup-gpg/
uses: ./.github/os-git-actions/setup-gpg/
with:
gpgPriv: ${{ inputs.gpgPriv }}
gpgPassPhrase: ${{ inputs.gpgPassPhrase }}

- name: Perform git commit
uses: ./.github/manual-commit/
uses: ./.github/os-git-actions/manual-commit/
with:
branch: ${{ inputs.branch }}
message: ${{ inputs.message }}
Expand Down
13 changes: 13 additions & 0 deletions .github/workflows/AddInnerSourcingLabel.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: Add Inner Sourcing Label

on:
pull_request:
types:
- opened

jobs:
inner_sourcing:
uses: OutSystems/rd.github-reusable-workflows/.github/workflows/add-inner-sourcing-label.yaml@v2.0.2
with:
codeowners-path: .github/CODEOWNERS
secrets: inherit
12 changes: 1 addition & 11 deletions .github/workflows/dev-pr.yml → .github/workflows/DevPR.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
name: DEV_PR
name: PullRequest into Dev branch
on:
# Triggers the workflow on push events but only for the "dev" branch.
pull_request:
branches: ['dev']

workflow_dispatch:

jobs:
eslint:
runs-on: ubuntu-latest
Expand All @@ -16,10 +14,6 @@ jobs:
- name: Checkout branch dev
uses: actions/checkout@v2

- uses: actions/setup-node@v1
with:
node-version: '16.x'

- name: Install project dependencies
run: npm install

Expand All @@ -33,10 +27,6 @@ jobs:
- name: Checkout branch dev
uses: actions/checkout@v2

- uses: actions/setup-node@v1
with:
node-version: '16.x'

- name: Install project dependencies
run: npm install

Expand Down
123 changes: 123 additions & 0 deletions .github/workflows/PreRelease.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
name: Pre-Release

on:
workflow_dispatch:
inputs:
new-version:
description: 'New version to be set. (1.0.1)'
type: string
required: true
release-date:
description: 'Release date. (YYYY-MM-DD)'
type: string
required: true
new-dev-release:
description: 'Set the new dev version. (1.0.1)'
type: string
required: false

jobs:
run-lint-on-dev:
runs-on: ubuntu-latest

if: ${{ inputs.new-version }}
steps:
- name: Checkout into dev
uses: actions/checkout@v4
with:
ref: dev
token: ${{ secrets.PAT }}

- name: Install project dependencies
run: npm install

- name: Run build
run: npm run build

create-rc:
needs: run-lint-on-dev
runs-on: ubuntu-latest

if: ${{ inputs.new-version }}
steps:
- name: Checkout into dev
uses: actions/checkout@v4
with:
ref: dev
token: ${{ secrets.PAT }}

- name: Create branch rc${{ inputs.new-version }}
run: |
git checkout -b rc${{ inputs.new-version }}
git push -u origin rc${{ inputs.new-version }}
set-tag:
needs: create-rc
runs-on: ubuntu-latest

if: ${{ inputs.new-version }}
steps:
- name: Checkout into rc${{ inputs.new-version }}
uses: actions/checkout@v4
with:
ref: rc${{ inputs.new-version }}
fetch-depth: 0
token: ${{ secrets.PAT }}

- name: Set tag
run: |
git tag v${{ inputs.new-version }} HEAD
git push origin --tags
set-pre-release:
needs: set-tag
runs-on: ubuntu-latest

if: ${{ inputs.new-version }}
steps:
- name: Create Release
id: create_release
uses: softprops/action-gh-release@v2.0.5
with:
tag_name: v${{ inputs.new-version }}
name: Release of version ${{ inputs.new-version }} (${{ inputs.release-date }})
body: |
### What's New
- First
- ...
### Fixed Issues and Improvements
- First
- ...
draft: false
prerelease: true
token: ${{ secrets.PAT }}

update-dev-version:
needs: create-rc
runs-on: ubuntu-latest

if: ${{ inputs.new-version && inputs.new-dev-release }}
steps:
- name: Checkout into dev
uses: actions/checkout@v4
with:
ref: dev
token: ${{ secrets.PAT }}

- name: Install project dependencies
run: npm install

- name: Update dev version into v${{ inputs.new-dev-release }}
run: |
npm run gta-update-version --newVersion=${{ inputs.new-dev-release }}
- name: Sign and Commit version increment to branch dev
uses: ./.github/os-git-actions/signed-commit/
with:
branch: dev
message: 'Updated into v${{ inputs.new-dev-release }} [skip ci]'
newFiles: true
gpgPriv: ${{ secrets.GPG_SIGN_KEY }}
gpgPassPhrase: ${{ secrets.GPG_PASSPHRASE }}
78 changes: 78 additions & 0 deletions .github/workflows/Release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
name: Release

on:
workflow_dispatch:
inputs:
new-version:
description: 'Version to be released.'
type: string
required: true
update-prerelease-into-latest:
description: 'Update pre-release into latest.'
type: boolean
default: true
delete-rc-branch:
description: 'Delete rc* branch at the end of process.'
type: boolean
default: true

jobs:
run-lint-on-rc:
runs-on: ubuntu-latest

if: ${{ inputs.new-version }}
steps:
- name: Checkout into rc${{ inputs.new-version }}
uses: actions/checkout@v4
with:
ref: rc${{ inputs.new-version }}
token: ${{ secrets.PAT }}

- name: Install project dependencies
run: npm install

- name: Run build
run: npm run build

merge-rc-into-main:
needs: run-lint-on-rc
runs-on: ubuntu-latest

if: ${{ inputs.new-version }}
steps:
- name: Merge rc${{ inputs.new-version }} into main
uses: everlytic/branch-merge@1.1.5
with:
github_token: ${{ secrets.PAT }}
source_ref: rc${{ inputs.new-version }}
target_branch: 'main'
commit_message_template: 'Merged rc${{ inputs.new-version }} into main. [skip ci]'

set-pre-release-as-lts:
needs: merge-rc-into-main
runs-on: ubuntu-latest

steps:
- name: Update v${{ inputs.new-version }} Tag Release from pre-release into latest
if: ${{ inputs.new-version && inputs.update-prerelease-into-latest == true }}
uses: softprops/action-gh-release@v2.0.5
with:
tag_name: v${{ inputs.new-version }}
prerelease: false
token: ${{ secrets.PAT }}

delete-rc-branch:
needs: merge-rc-into-main
runs-on: ubuntu-latest

if: ${{ inputs.delete-rc-branch == true }}
steps:
- name: Checkout branch dev
uses: actions/checkout@v4
with:
ref: dev

- name: Delete branch rc${{ inputs.new-version }}
shell: bash
run: |
git push origin -d rc${{ inputs.new-version }}
9 changes: 9 additions & 0 deletions .github/workflows/ValidatePRLabels.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
name: Validate pull request labels

on:
pull_request:
types: [opened, reopened, labeled, unlabeled]

jobs:
check-label:
uses: OutSystems/rd.github-reusable-workflows/.github/workflows/validate-pr-labels.yaml@v2.0.2
11 changes: 11 additions & 0 deletions .github/workflows/ValidatePRTitle.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: Validate pull request title

on:
pull_request:
types: [opened, reopened, edited]

jobs:
build:
uses: OutSystems/rd.github-reusable-workflows/.github/workflows/validate-pr-title.yaml@v2.0.2
with:
validate-semVer: false
86 changes: 0 additions & 86 deletions .github/workflows/main-push.yml

This file was deleted.

0 comments on commit b90b4d4

Please sign in to comment.