Skip to content

Commit

Permalink
feat: new gha workflow to create releases with bundled assets (#2153)
Browse files Browse the repository at this point in the history
* chore: add release workflow

* chore: adjust release workflow
  • Loading branch information
Arturo Castillo Delgado authored Oct 9, 2023
1 parent f00f7f8 commit ca22494
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 0 deletions.
62 changes: 62 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -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
1 change: 1 addition & 0 deletions packages/components-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 1 addition & 0 deletions packages/components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit ca22494

Please sign in to comment.