Skip to content

Commit

Permalink
Update release.yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
MelleD authored Apr 26, 2024
1 parent 48f484a commit ecfe772
Showing 1 changed file with 43 additions and 45 deletions.
88 changes: 43 additions & 45 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -1,64 +1,62 @@
name: Build & Release
name: "Release"

on:
push:
branches:
- main
workflow_dispatch:
inputs:
release_version:
description: 'Version number of the release'
required: true

jobs:
build-and-release:
name: Build & Release
gh_tagged_release:
name: Create tagged release
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

steps:
- name: Checkout
- name: Checkout project
uses: actions/checkout@v4

- name: Get yarn cache
id: yarn-cache
run: echo "::set-output name=dir::$(yarn cache dir)"

- uses: actions/cache@v4
- name: Setup Git
run: |
git config user.name github-actions
git config user.email github-actions@github.com
- name: Cache node modules
uses: actions/cache@v4
env:
cache-name: cache-node-modules
with:
path: ${{ steps.yarn-cache.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
path: ~/.npm
key: ${{ runner.os }}-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Setup Node
${{ runner.os }}-${{ env.cache-name }}-
${{ runner.os }}-
- name: Setup NodeJs
uses: actions/setup-node@v4
with:
node-version: 22
node-version: '20'
cache: 'npm'
cache-dependency-path: '**/package-lock.json'

- name: Install Dependencies
run: yarn install --frozen-lockfile

- name: Lint
run: yarn lint
run: npm install

#- name: Test
# run: yarn test
- name: Set app version (Unix)
run: npm version ${{ github.event.inputs.release_version }} --no-git-tag-version

- name: Build
run: yarn build

- uses: rymndhng/release-on-push-action@master
id: release
with:
bump_version_scheme: minor
use_github_release_notes: true

- name: Log Release Version
run: |
echo "Created tag name: ${{ steps.release.outputs.tag_name }}"
echo "Created release version: ${{ steps.release.outputs.version }}"
- name: Build Project
run: npm run build

- name: Upload JS card file to release
uses: svenstaro/upload-release-action@v2
- name: "Create Github release (full)"
if: ${{ !contains( github.event.inputs.release_version, '-rc' ) }}
uses: softprops/action-gh-release@v1
id: lovelace_horizon_card_release
with:
overwrite: true
repo_token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ steps.release.outputs.version }}
file: dist/lovelace-horizon-card.js
body: "Release version ${{ github.event.inputs.release_version }}."
tag_name: ${{ github.event.inputs.release_version }}
target_commitish: "main"
draft: false
prerelease: false
files: dist/lovelace-horizon-card.js
generate_release_notes: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit ecfe772

Please sign in to comment.