-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add github superlinter and auto release job
- Loading branch information
Showing
4 changed files
with
190 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
name: Lint | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
branches: | ||
- master | ||
|
||
permissions: { } | ||
|
||
jobs: | ||
build: | ||
name: Lint | ||
runs-on: ubuntu-latest | ||
|
||
permissions: | ||
contents: read | ||
packages: read | ||
# To report GitHub Actions status checks | ||
statuses: write | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
with: | ||
# super-linter needs the full git history to get the | ||
# list of files that changed across commits | ||
fetch-depth: 0 | ||
|
||
- name: Super-linter | ||
uses: super-linter/super-linter@v6.4.1 # x-release-please-version | ||
env: | ||
# To report GitHub Actions status checks | ||
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
name: Release | ||
|
||
on: | ||
release: | ||
types: [released] | ||
|
||
defaults: | ||
run: | ||
shell: bash | ||
|
||
jobs: | ||
generate_zip: | ||
name: Generate release zip | ||
runs-on: [ubuntu-latest] | ||
timeout-minutes: 60 | ||
steps: | ||
- name: Checkout Source Code | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
clean: true | ||
|
||
- name: Show Output Directory For Debug Purpose | ||
run: | | ||
apt update && apt install zip || exit 1 | ||
echo “show runner hostname” | ||
hostname | ||
echo “show runner user” | ||
whoami | ||
echo “show runner pwd” | ||
pwd | ||
echo “show runner kernel” | ||
uname -a | ||
echo “show runner pwd file list” | ||
ls | ||
ls -alht custom_components/midea_ac_lan/ || exit 1 | ||
echo "show manifest.json for debug" | ||
cat custom_components/midea_ac_lan/manifest.json || exit 1 | ||
sudo mkdir -p /github/workspace/artifacts || exit 1 | ||
sudo chown -R $(id -u):$(id -g) /github/workspace/artifacts || exit 1 | ||
sudo chmod -R 755 /github/workspace/artifacts || exit 1 | ||
cd custom_components/midea_ac_lan/ || exit 1 | ||
zip -r ../midea_ac_lan.zip ./* || exit 1 | ||
cp ../midea_ac_lan.zip /github/workspace/artifacts/midea_ac_lan.zip || exit 1 | ||
ls -alht /github/workspace/artifacts/ || exit 1 | ||
shell: bash | ||
|
||
- name: Upload Artifacts | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: midea_ac_lan.zip | ||
path: /github/workspace/artifacts | ||
|
||
upload_release: | ||
needs: generate_zip | ||
name: Publish release | ||
if: ${{ startsWith(github.ref, 'refs/tags/v') }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
|
||
- name: Download All Artifacts | ||
uses: actions/download-artifact@v4 | ||
with: | ||
path: artifacts | ||
pattern: midea_ac_lan.zip | ||
merge-multiple: true | ||
|
||
- name: Display Structure of Artifacts Files | ||
run: ls -R | ||
|
||
- name: Show Working Directory For Debug Purpose | ||
run: | | ||
echo “show runner hostname” | ||
hostname | ||
echo “show runner user” | ||
whoami | ||
echo “show runner pwd” | ||
pwd | ||
echo “show runner kernel” | ||
uname -a | ||
echo “show runner pwd file list” | ||
ls | ||
ls -alht | ||
echo “show runner artifacts” | ||
ls -alht artifacts || exit 0 | ||
echo "github.ref: ${{github.ref}} " | ||
- name: Upload images to Release Asset | ||
uses: softprops/action-gh-release@v2 | ||
with: | ||
files: artifacts/midea_ac_lan.zip | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.