mirror of
https://github.com/Websoft9/websoft9.git
synced 2025-01-24 01:50:19 +08:00
combine release and dev action
This commit is contained in:
parent
28c8bdb6a8
commit
c576806db4
46
.github/workflows/upload_artifact.yml
vendored
46
.github/workflows/upload_artifact.yml
vendored
@ -1,11 +1,11 @@
|
|||||||
name: upload_artifact
|
name: upload_artifact(decide by version)
|
||||||
|
|
||||||
on:
|
on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
push:
|
push:
|
||||||
branches: [main]
|
branches: [main]
|
||||||
paths:
|
paths:
|
||||||
- "version2.json"
|
- "version.json"
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
upload_artifact:
|
upload_artifact:
|
||||||
@ -20,13 +20,20 @@ jobs:
|
|||||||
id: update_data
|
id: update_data
|
||||||
run: |
|
run: |
|
||||||
version=$(jq -r '.version' version.json)
|
version=$(jq -r '.version' version.json)
|
||||||
echo version=$version
|
real_version=${version%%-*}
|
||||||
echo "VERSION=$version" >> $GITHUB_ENV
|
echo "VERSION=$real_version" >> $GITHUB_ENV
|
||||||
changelog=$(cat changelog_latest.md)
|
changelog=$(cat changelog_latest.md)
|
||||||
echo "CHANGELOG<<EOF" >> $GITHUB_OUTPUT
|
echo "CHANGELOG<<EOF" >> $GITHUB_OUTPUT
|
||||||
echo "$changelog" >> $GITHUB_OUTPUT
|
echo "$changelog" >> $GITHUB_OUTPUT
|
||||||
echo "EOF" >> $GITHUB_OUTPUT
|
echo "EOF" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
|
if [[ $version == *-* ]]; then
|
||||||
|
echo "release version"
|
||||||
|
echo "::set-output name=release::true"
|
||||||
|
else
|
||||||
|
echo "rc release version"
|
||||||
|
echo "::set-output name=release::false"
|
||||||
|
fi
|
||||||
mkdir websoft9 artifacts
|
mkdir websoft9 artifacts
|
||||||
cp -r docker websoft9
|
cp -r docker websoft9
|
||||||
cp -r cockpit websoft9
|
cp -r cockpit websoft9
|
||||||
@ -39,13 +46,36 @@ jobs:
|
|||||||
zip -r websoft9-$version.zip websoft9
|
zip -r websoft9-$version.zip websoft9
|
||||||
cp websoft9-$version.zip artifacts
|
cp websoft9-$version.zip artifacts
|
||||||
cp install/install.sh artifacts
|
cp install/install.sh artifacts
|
||||||
cp install/update.sh artifacts
|
|
||||||
cp version.json artifacts
|
cp version.json artifacts
|
||||||
cp CHANGELOG.md artifacts
|
cp CHANGELOG.md artifacts
|
||||||
cp artifacts/websoft9-$version.zip artifacts/websoft9-latest.zip
|
cp artifacts/websoft9-$version.zip artifacts/websoft9-latest.zip
|
||||||
|
|
||||||
- name: Upload To Azure Blob
|
- name: Upload To Azure Blob
|
||||||
uses: LanceMcCarthy/Action-AzureBlobUpload@v2
|
uses: LanceMcCarthy/Action-AzureBlobUpload@v2
|
||||||
|
if: ${{ steps.check_changes.outputs.release == 'false' }}
|
||||||
|
with:
|
||||||
|
connection_string: ${{ secrets.AZURE_STORAGE_ARTIFACT }}
|
||||||
|
container_name: dev
|
||||||
|
source_folder: artifacts/
|
||||||
|
destination_folder: ./websoft9
|
||||||
|
delete_if_exists: true
|
||||||
|
fail_if_source_empty: true
|
||||||
|
|
||||||
|
- name: Create Release
|
||||||
|
id: create_release
|
||||||
|
uses: softprops/action-gh-release@v1
|
||||||
|
if: ${{ steps.check_changes.outputs.release == 'false' }}
|
||||||
|
with:
|
||||||
|
files: /*
|
||||||
|
tag_name: v${{ env.VERSION }}-rc
|
||||||
|
title: Release-v${{ env.VERSION }}-rc
|
||||||
|
body: ${{ steps.update_data.outputs.CHANGELOG }}
|
||||||
|
draft: false
|
||||||
|
prerelease: false
|
||||||
|
|
||||||
|
- name: Upload To Azure Blob
|
||||||
|
uses: LanceMcCarthy/Action-AzureBlobUpload@v2
|
||||||
|
if: ${{ steps.check_changes.outputs.release == 'true' }}
|
||||||
with:
|
with:
|
||||||
connection_string: ${{ secrets.AZURE_STORAGE_ARTIFACT }}
|
connection_string: ${{ secrets.AZURE_STORAGE_ARTIFACT }}
|
||||||
container_name: release
|
container_name: release
|
||||||
@ -57,6 +87,7 @@ jobs:
|
|||||||
- name: Create Release
|
- name: Create Release
|
||||||
id: create_release
|
id: create_release
|
||||||
uses: softprops/action-gh-release@v1
|
uses: softprops/action-gh-release@v1
|
||||||
|
if: ${{ steps.check_changes.outputs.release == 'true' }}
|
||||||
with:
|
with:
|
||||||
files: /*
|
files: /*
|
||||||
tag_name: v${{ env.VERSION }}
|
tag_name: v${{ env.VERSION }}
|
||||||
@ -64,8 +95,3 @@ jobs:
|
|||||||
body: ${{ steps.update_data.outputs.CHANGELOG }}
|
body: ${{ steps.update_data.outputs.CHANGELOG }}
|
||||||
draft: false
|
draft: false
|
||||||
prerelease: false
|
prerelease: false
|
||||||
|
|
||||||
# - name: Commit and push changes
|
|
||||||
# uses: stefanzweifel/git-auto-commit-action@v4
|
|
||||||
# with:
|
|
||||||
# commit_message: Push to github main
|
|
||||||
|
70
.github/workflows/upload_dev_artifact.yml
vendored
70
.github/workflows/upload_dev_artifact.yml
vendored
@ -1,70 +0,0 @@
|
|||||||
name: upload_dev_artifact
|
|
||||||
|
|
||||||
on:
|
|
||||||
workflow_dispatch:
|
|
||||||
push:
|
|
||||||
branches: [main]
|
|
||||||
paths:
|
|
||||||
- "version.json"
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
upload_artifact:
|
|
||||||
name: Bupload_artifact
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v2
|
|
||||||
name: Check out code
|
|
||||||
|
|
||||||
- name: Read Plugin Version
|
|
||||||
id: update_data
|
|
||||||
run: |
|
|
||||||
version=$(jq -r '.version' version.json)
|
|
||||||
echo version=$version
|
|
||||||
echo "VERSION=$version" >> $GITHUB_ENV
|
|
||||||
changelog=$(cat changelog_latest.md)
|
|
||||||
echo "CHANGELOG<<EOF" >> $GITHUB_OUTPUT
|
|
||||||
echo "$changelog" >> $GITHUB_OUTPUT
|
|
||||||
echo "EOF" >> $GITHUB_OUTPUT
|
|
||||||
|
|
||||||
mkdir websoft9 artifacts
|
|
||||||
cp -r docker websoft9
|
|
||||||
cp -r cockpit websoft9
|
|
||||||
cp -r scripts websoft9
|
|
||||||
cp -r install websoft9
|
|
||||||
cp -r docs websoft9
|
|
||||||
cp -r systemd websoft9
|
|
||||||
cp *.md websoft9
|
|
||||||
cp version.json websoft9
|
|
||||||
zip -r websoft9-$version.zip websoft9
|
|
||||||
cp websoft9-$version.zip artifacts
|
|
||||||
cp install/install.sh artifacts
|
|
||||||
cp version.json artifacts
|
|
||||||
cp CHANGELOG.md artifacts
|
|
||||||
cp artifacts/websoft9-$version.zip artifacts/websoft9-latest.zip
|
|
||||||
|
|
||||||
- name: Upload To Azure Blob
|
|
||||||
uses: LanceMcCarthy/Action-AzureBlobUpload@v2
|
|
||||||
with:
|
|
||||||
connection_string: ${{ secrets.AZURE_STORAGE_ARTIFACT }}
|
|
||||||
container_name: dev
|
|
||||||
source_folder: artifacts/
|
|
||||||
destination_folder: ./websoft9
|
|
||||||
delete_if_exists: true
|
|
||||||
fail_if_source_empty: true
|
|
||||||
|
|
||||||
- name: Create Release
|
|
||||||
id: create_release
|
|
||||||
uses: softprops/action-gh-release@v1
|
|
||||||
with:
|
|
||||||
files: /*
|
|
||||||
tag_name: v${{ env.VERSION }}-rc
|
|
||||||
title: Release-v${{ env.VERSION }}-rc
|
|
||||||
body: ${{ steps.update_data.outputs.CHANGELOG }}
|
|
||||||
draft: false
|
|
||||||
prerelease: false
|
|
||||||
|
|
||||||
# - name: Commit and push changes
|
|
||||||
# uses: stefanzweifel/git-auto-commit-action@v4
|
|
||||||
# with:
|
|
||||||
# commit_message: Push to github main
|
|
@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"version": "0.8.23",
|
"version": "0.8.24-rc",
|
||||||
"plugins": {
|
"plugins": {
|
||||||
"portainer": "0.0.6",
|
"portainer": "0.0.6",
|
||||||
"nginx": "0.0.5",
|
"nginx": "0.0.5",
|
||||||
|
Loading…
Reference in New Issue
Block a user