Skip to content

Commit

Permalink
build
Browse files Browse the repository at this point in the history
  • Loading branch information
ljmerza committed Jan 4, 2024
1 parent e381207 commit 268673c
Show file tree
Hide file tree
Showing 4 changed files with 81 additions and 232 deletions.
64 changes: 64 additions & 0 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: Build and Release on Tag

on:
push:
tags:
- '*'

jobs:
build-and-release:
runs-on: ubuntu-latest

steps:
- name: Checkout Repository
uses: actions/checkout@v3

- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '16'

- name: Install Dependencies
run: npm install

- name: Run Build
run: npm run build

- name: Commit dist folder
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git add dist/
git commit -m "Add dist folder"
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
force: true
directory: dist

- name: Extract Tag Name
id: tag_name
run: echo "::set-output name=tag::$(echo ${GITHUB_REF#refs/tags/})"

- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.tag_name.outputs.tag }}
release_name: Release ${{ steps.tag_name.outputs.tag }}
draft: false
prerelease: false

- name: Upload Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./dist/tracking-number-cardjs
asset_name: tracking-number-cardjs
asset_content_type: application/javascript
17 changes: 17 additions & 0 deletions .github/workflows/validate.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Validate

on:
push:
pull_request:
schedule:
- cron: "0 0 * * *"

jobs:
validate:
runs-on: "ubuntu-latest"
steps:
- uses: "actions/checkout@v2"
- name: HACS validation
uses: "hacs/action@main"
with:
category: "plugin"
231 changes: 0 additions & 231 deletions dist/tracking-number-card.js

This file was deleted.

1 change: 0 additions & 1 deletion dist/tracking-number-card.js.map

This file was deleted.

0 comments on commit 268673c

Please sign in to comment.