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

Feat/switch to GitHub actions #566

Draft
wants to merge 87 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
87 commits
Select commit Hold shift + click to select a range
6920263
feat: test build usig github action
vadson71 Feb 21, 2023
151e94d
fix: script fix
vadson71 Feb 21, 2023
fa1c300
fix: script
vadson71 Feb 21, 2023
ce906fe
fix: spaces
vadson71 Feb 21, 2023
9afb034
feat: check out fix
vadson71 Feb 21, 2023
436e5fe
feat: compiance check added
vadson71 Feb 21, 2023
4c1ec74
feat: version test
vadson71 Feb 22, 2023
b099950
feat: build script change
vadson71 Feb 22, 2023
f919470
fix: syntax
vadson71 Feb 22, 2023
e919f59
fix: syntax
vadson71 Feb 22, 2023
904984d
fix: syntax
vadson71 Feb 22, 2023
8c70677
fix: script fix
vadson71 Feb 22, 2023
f2aefa5
fix: syntax
vadson71 Feb 22, 2023
34013c5
fix: syntax
vadson71 Feb 22, 2023
3bc2bd3
fix: mkdir fix
vadson71 Feb 23, 2023
a42efb8
feat: manual script
vadson71 Feb 23, 2023
2728892
fix: no inputs
vadson71 Feb 23, 2023
72fab70
feat: debug
vadson71 Feb 24, 2023
86c58ae
Update release_manual.yaml
vadson71 Feb 24, 2023
68ff449
Update release_manual.yaml
vadson71 Feb 24, 2023
c93efa5
fix: pkg.json
vadson71 Feb 24, 2023
88c832c
Merge branch 'feat/switch-to-github-actions' of https://github.com/va…
vadson71 Feb 24, 2023
14cbab8
feat: test version action
vadson71 Feb 24, 2023
e864ee2
Update release_manual.yaml
vadson71 Feb 24, 2023
251ea7d
chore: apply latest changesets
invalid-email-address Feb 24, 2023
1f216b4
feat: debug
vadson71 Feb 24, 2023
4a80c98
chore: apply latest changesets
invalid-email-address Feb 24, 2023
5d940c5
feat: debug
vadson71 Feb 24, 2023
3f56702
chore: apply latest changesets
invalid-email-address Feb 24, 2023
080ae49
feat: debug
vadson71 Feb 24, 2023
34c71bf
Update release_manual.yaml
vadson71 Feb 24, 2023
03e78a7
feat: debug
vadson71 Feb 24, 2023
eac8c8f
Merge branch 'feat/switch-to-github-actions' of https://github.com/va…
vadson71 Feb 24, 2023
e327867
Update release_manual.yaml
vadson71 Feb 24, 2023
6d1bbd3
chore: apply latest changesets
invalid-email-address Feb 24, 2023
a4db98f
feat: tag debug
vadson71 Feb 24, 2023
ab78b00
Update release_manual.yaml
vadson71 Feb 24, 2023
fca6900
chore: apply latest changesets
invalid-email-address Feb 24, 2023
ceae46e
feat: publish script
vadson71 Feb 24, 2023
5088a09
Merge branch 'feat/switch-to-github-actions' of https://github.com/va…
vadson71 Feb 24, 2023
75ccd2b
Update release.yaml
vadson71 Feb 24, 2023
8848a45
fix: bug fix
vadson71 Feb 24, 2023
199aefb
Update release.yaml
vadson71 Feb 24, 2023
8942d6e
Update release.yaml
vadson71 Feb 24, 2023
d97230b
Update release.yaml
vadson71 Feb 24, 2023
c4ec4da
fix: deploy script fix
vadson71 Feb 24, 2023
5310c83
Merge branch 'feat/switch-to-github-actions' of https://github.com/va…
vadson71 Feb 24, 2023
c08b0c2
Update release.yaml
vadson71 Feb 24, 2023
053f381
feat: test
vadson71 Feb 24, 2023
032d793
Merge branch 'feat/switch-to-github-actions' of https://github.com/va…
vadson71 Feb 24, 2023
8244c46
chore: apply latest changesets
invalid-email-address Feb 24, 2023
c43485f
fix: debug
vadson71 Feb 24, 2023
5c94241
Merge branch 'feat/switch-to-github-actions' of https://github.com/va…
vadson71 Feb 24, 2023
263bfa9
chore: apply latest changesets
invalid-email-address Feb 24, 2023
213f3c2
fix: debug
vadson71 Feb 24, 2023
0702670
Merge branch 'feat/switch-to-github-actions' of https://github.com/va…
vadson71 Feb 24, 2023
f4dc742
chore: apply latest changesets
invalid-email-address Feb 24, 2023
1a130cd
fix: debug
vadson71 Feb 24, 2023
87529fb
Merge branch 'feat/switch-to-github-actions' of https://github.com/va…
vadson71 Feb 24, 2023
5924ed8
Update release.yaml
vadson71 Feb 24, 2023
f032e30
fix: bug fix
vadson71 Feb 27, 2023
b29b60c
Merge branch 'feat/switch-to-github-actions' of https://github.com/va…
vadson71 Feb 27, 2023
d9adc91
chore: apply latest changesets
invalid-email-address Feb 27, 2023
ac51852
feat: test
vadson71 Feb 27, 2023
acfbbe7
chore: apply latest changesets
invalid-email-address Feb 27, 2023
892d2e2
Update release_manual.yaml
vadson71 Feb 28, 2023
c1fd7a1
Update release_manual.yaml
vadson71 Feb 28, 2023
c88d913
feat: pat test full cycle
vadson71 Feb 28, 2023
0d67579
Merge branch 'feat/switch-to-github-actions' of https://github.com/va…
vadson71 Feb 28, 2023
745906a
fix: cleanup
vadson71 Feb 28, 2023
1fa75fe
chore: apply latest changesets
invalid-email-address Feb 28, 2023
3d249ac
fix: deploy fix
vadson71 Feb 28, 2023
4e07d30
feat: test
vadson71 Feb 28, 2023
6171bab
Merge branch 'feat/switch-to-github-actions' of https://github.com/va…
vadson71 Feb 28, 2023
fd1a1f8
chore: apply latest changesets
invalid-email-address Feb 28, 2023
a2b68bd
fix: beta release
vadson71 Mar 8, 2023
793dc2d
Merge branch 'feat/switch-to-github-actions' of https://github.com/va…
vadson71 Mar 8, 2023
0765934
fix: bug fix
vadson71 Mar 8, 2023
ab5924f
feat: sonar check step added
vadson71 Mar 8, 2023
a307eca
feat: debug
vadson71 Mar 8, 2023
9d09cee
feat: sonar config added
vadson71 Mar 8, 2023
bfbe12b
feat: circle ci deactivated
vadson71 Mar 8, 2023
a4fed4c
fix: sonar config fix
vadson71 Mar 8, 2023
cf6c689
fix: sonar script correction
vadson71 Mar 8, 2023
a22be6a
fix: script fix
vadson71 Mar 8, 2023
dc429a8
fix: sonar reports analysis off
vadson71 Mar 8, 2023
414b144
feat: sq excluded
vadson71 Mar 8, 2023
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
8 changes: 8 additions & 0 deletions .changeset/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Changesets

Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
with multi-package repos, or single-package repos to help you version and publish your code. You can
find the full documentation for it [in our repository](https://github.com/changesets/changesets)

We have a quick list of common questions to get you started engaging with this project in
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)
11 changes: 11 additions & 0 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
"changelog": "@changesets/cli/changelog",
"commit": false,
"fixed": [],
"linked": [],
"access": "public",
"baseBranch": "master",
"updateInternalDependencies": "patch",
"ignore": []
}
File renamed without changes.
140 changes: 140 additions & 0 deletions .github/workflows/pipeline.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,140 @@
name: CI/CD Pipeline

on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
build:
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
node-version: [14.x, 16.x, 18.x]
runs-on: ${{ matrix.os }}
timeout-minutes: 15
steps:
- name: Checkout code repository
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup pnpm
uses: pnpm/[email protected]
with:
version: 7.1.0
run_install: true
- name: Cache pnpm modules
uses: actions/cache@v3
env:
cache-name: cache-pnpm-modules
with:
path: ~/.pnpm-store
key: ${{ matrix.os }}-build-${{ env.cache-name }}-${{ matrix.node-version }}-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ matrix.os }}-build-${{ env.cache-name }}-${{ matrix.node-version }}-
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Install pnpm modules
run: pnpm install
- name: Run build
run: pnpm run build
- name: Run unit tests
run: pnpm run test
- name: Run SonarCloud scan
if: matrix.os == 'ubuntu-latest' && matrix.node-version == '14.x'
uses: sonarsource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.ACCESS_PAT }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
version:
# Run version job only on pushes to the main branch. The job depends on completion of the build job.
if: github.repository == 'SAP/open-ux-tools' && github.event_name == 'push' && github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
needs: build
outputs:
changes: ${{ steps.changesetVersion.outputs.changes }} # map step output to job output
steps:
- name: Checkout code repository
uses: actions/checkout@v3
with:
fetch-depth: 0
token: ${{ secrets.ACCESS_PAT }}
- name: Setup pnpm
uses: pnpm/[email protected]
with:
version: 7.1.0
run_install: true
- name: Cache pnpm modules
uses: actions/cache@v3
env:
cache-name: cache-pnpm-modules
with:
path: ~/.pnpm-store
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
- name: Use Node.js 14.x
uses: actions/setup-node@v3
with:
node-version: 14.x
- name: Install pnpm modules
run: pnpm install
- name: Apply changesets
id: changesetVersion
run: |
echo ::set-output name=changes::$(pnpm ci:version 2>&1 | grep -q 'No unreleased changesets found' && echo 'false' || echo 'true')
git status
- name: Commit and push changes
if: steps.changesetVersion.outputs.changes == 'true'
run: |
git config user.name github-actions
git config user.email [email protected]
git status
git add -A
git status
git commit -m "chore: apply latest changesets" --no-verify || echo "No changesets found"
git log --pretty=oneline | head -n 10
git push

release:
# Run release job only on pushes to the main branch. The job depends on completion of the build job.
# This job needs to run after the version job commit has been merged - so check if that step returns 'false'
if: github.repository == 'SAP/open-ux-tools' && github.event_name == 'push' && github.ref == 'refs/heads/main' && needs.version.outputs.changes == 'false'
runs-on: ubuntu-latest
needs: version
steps:
- name: Checkout code repository
uses: actions/checkout@v3
- name: Setup pnpm
uses: pnpm/[email protected]
with:
version: 7.1.0
run_install: true
- name: Cache pnpm modules
uses: actions/cache@v3
env:
cache-name: cache-pnpm-modules
with:
path: ~/.pnpm-store
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
- name: Use Node.js 14.x
uses: actions/setup-node@v3
with:
node-version: 14.x
- name: Install pnpm modules
run: pnpm install
- name: Run build
run: pnpm run build
- name: Setup npmrc with npmjs.com token
run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPMJS_TOKEN }}" > .npmrc
- name: 'Publish to npmjs'
uses: changesets/[email protected]
with:
publish: pnpm ci:publish
env:
GITHUB_TOKEN: ${{ secrets.ACCESS_PAT }}
157 changes: 157 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,157 @@
name: Release workflow

on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'

env:
GHR_PROJECT_REPONAME: ui5-language-assistant
GHR_PROJECT_USERNAME: SAP

jobs:
build:
if: github.repository == 'vadson71/ui5-language-assistant-vk' && contains(github.ref, 'refs/tags/v')
strategy:
matrix:
os: [ubuntu-latest]
node-version: [14.x, 16.x, 18.x]
runs-on: ${{ matrix.os }}
outputs:
changes: ${{ steps.package-version.outputs.current-version }} # map step output to job output

steps:
- run: echo ${{env.BRANCH_NAME}} # TODO remove
- run: echo ${{github.ref }}
- name: Checkout code repository
uses: actions/checkout@v3
with:
fetch-depth: 0 # will fetch all history
- name: Run install
uses: borales/actions-yarn@v4
with:
cmd: install # will run `yarn install` command
# env:
# NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} # if needed
- name: Run build
uses: borales/actions-yarn@v4
with:
cmd: build:ck # TODO: will run `yarn run ci` command

- name: Upload vsix artifact
uses: actions/upload-artifact@v3
with:
name: vscode-extension-file
path: ./packages/vscode-ui5-language-assistant/vscode-ui5-language-assistant*.vsix
if-no-files-found: error # 'warn' or 'ignore' are also available, defaults to `warn`

# Get release version number
- name: get-npm-version
id: package-version
uses: martinbeentjes/npm-get-version-action@main
with:
path: ./packages/vscode-ui5-language-assistant

gh-delpoy:
# env:
# GOPATH: ~/go
strategy:
matrix:
os: [ubuntu-latest]
node-version: [14.x]
runs-on: ${{ matrix.os }}
needs: build
steps:
- name: Setup Go 1.18
uses: actions/setup-go@v3
with:
go-version: '^1.18'
- name: 'prepare to deploy'
run:
go version
#- name: Scripts
# uses: alinz/script.go@main
# with:
# workspace: ${{ github.workspace }} # <- this is important
# paths: .github/workflows/one,.github/workflows/two #<- the path to your go scripts

# Download vsix artifact
- name: 'make folder'
run: mkdir ./artifacts
- name: Download artifact
uses: actions/download-artifact@v3
with:
name: vscode-extension-file
path: ./artifacts
- name: 'check artifacts'
run: ls ./artifacts -la

# Publish on GitHub
- name: 'Publish Release on GitHub'
# run: echo 'export GOPATH=~/go' >> $BASH_ENV
run: go install github.com/tcnksm/ghr@latest

- name: Check
run: echo ${{ secrets.GITHUB_TOKEN }} -u ${{env.GHR_PROJECT_USERNAME}} -r ${{env.GHR_PROJECT_REPONAME}} -replace ${{ needs.build.outputs.current-version}} ./artifacts/
# ghr -t ${{ secrets.GITHUB_TOKEN }} -u ${{env.GHR_PROJECT_USERNAME}} -r ${{env.GHR_PROJECT_REPONAME}} -replace ${{ needs.build.outputs.current-version}} ./artifacts/

deploy-npm:
strategy:
matrix:
os: [ubuntu-latest]
node-version: [14.x]
runs-on: ${{ matrix.os }}
needs: build

steps:
- name: Prerequisite
run: sudo apt-get install libxss1

- name: Checkout code repository
uses: actions/checkout@v3
with:
fetch-depth: 0 # will fetch all history

# Pure lockfile simply doesn't write the lockfile if it has changes.
- name: Run install
uses: borales/actions-yarn@v4
with:
cmd: install --pure-lockfile

# reuse stored generated vsix
- name: Download artifact
uses: actions/download-artifact@v3
with:
name: vscode-extension-file
path: ./packages/vscode-ui5-language-assistant-bas-ext


# - name: Run build
# uses: borales/actions-yarn@v4
# with:
# cmd: build:quick # will run `yarn run ci` command

# - name: Copy vsix
# uses: borales/actions-yarn@v4
# with:
# cmd: ci # will run `yarn run ci` command
# dir: './packages/vscode-ui5-language-assistant-bas-ext'

- name: Check
run: ls ./packages/vscode-ui5-language-assistant-bas-ext -la

- name: Prepare .npmrc
run:
echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" >> ~/.npmrc

# To help debug when lerna detects changes to the working tree and fails the publish
- name: Status
run: git status

# - name: Publish
# # https://github.com/lerna/lerna/issues/2788
# uses: borales/actions-yarn@v4
# with:
# cmd: run release:publish --no-verify-access


Loading