diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000000..450e63e277 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,62 @@ +name: release +on: + push: + tags: + - "v*" + # workflow_dispatch: {} + +jobs: + release: + runs-on: ubuntu-20.04 + # environment: RELEASE + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: 16 + + - name: Restore Lerna + id: yarn-cache + uses: actions/cache@v3 + with: + path: | + node_modules + */*/node_modules + key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }} + + - name: Install project dependencies + if: steps.yarn-cache.outputs.cache-hit != 'true' + run: yarn + + - name: Bootstrap + if: steps.yarn-cache.outputs.cache-hit != 'true' + run: | + yarn bootstrap + + - name: Build Components + run: | + yarn workspace @telekom/scale-components build + yarn workspace @telekom/scale-components zip + + - name: Build React Proxy + run: | + yarn workspace @telekom/scale-components-react build + yarn workspace @telekom/scale-components-react zip + + - name: Get Package Version + id: package-version + uses: martinbeentjes/npm-get-version-action@v1.3.1 + with: + path: packages/components + + - name: Create GitHub Release + uses: "marvinpinto/action-automatic-releases@latest" + with: + repo_token: "${{ secrets.GITHUB_TOKEN }}" + automatic_release_tag: "latest" + prerelease: false + title: ${{ steps.package-version.outputs.current-version }} + files: | + LICENSE + packages/components/telekom-scale-components-${{ steps.package-version.outputs.current-version }}.zip + packages/components-react/telekom-scale-components-react-${{ steps.package-version.outputs.current-version }}.zip diff --git a/packages/components-react/package.json b/packages/components-react/package.json index 5bd3dd57e9..89b5606d5a 100755 --- a/packages/components-react/package.json +++ b/packages/components-react/package.json @@ -14,6 +14,7 @@ }, "scripts": { "build": "yarn clean && yarn rollup", + "zip": "zip -vr telekom-scale-components-react-$npm_package_version.zip dist/ -x '*.DS_Store'", "clean": "rimraf dist", "format": "prettier --write \"package.json\"", "rollup": "rollup -c" diff --git a/packages/components/package.json b/packages/components/package.json index 2394f4c2fa..b5cd88aafc 100644 --- a/packages/components/package.json +++ b/packages/components/package.json @@ -27,6 +27,7 @@ "build:whitelabel": "WHITELABEL=1 stencil build --docs-readme", "build:watch": "stencil build --watch --serve --config stencil-dev.config.ts", "build:staging": "stencil build --config stencil-staging.config.ts", + "zip": "zip -vr telekom-scale-components-$npm_package_version.zip dist/ -x '*.DS_Store' 'dist/collection/**'", "start": "stencil build --dev --watch --serve --config stencil-dev.config.ts", "dev": "yarn start", "test": "stencil test --max-workers=2",