-
Notifications
You must be signed in to change notification settings - Fork 89
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add workflow to create pre-release on version change
This commit introduces a new workflow file `beta-release.yml` that runs on the `v3-alpha` branch. The workflow checks for changes in the package version and creates a pre-release if the version has changed. It uses GitHub Actions, Node.js, and the `actions/checkout`, `actions/setup-node`, and `curl` actions to handle the required steps. The workflow performs the following steps: - Checks out the code - Sets up Node.js - Installs dependencies - Retrieves the previous and current package versions - Compares the versions and determines if a pre-release is needed - Creates a pre-release using the GitHub API if needed
- Loading branch information
1 parent
186b088
commit 5086ece
Showing
10 changed files
with
97 additions
and
27 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,47 @@ | ||
name: Create Pre-Release on Version Change | ||
|
||
on: | ||
push: | ||
branches: | ||
- v3-alpha | ||
|
||
jobs: | ||
check-version-and-create-release: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up Node.js | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: '14' | ||
|
||
- name: Install dependencies | ||
run: npm install | ||
|
||
- name: Get previous package version | ||
id: get_prev_version | ||
run: echo "::set-output name=prev_version::$(git show HEAD^:package.json | jq -r '.version')" | ||
|
||
- name: Get current package version | ||
id: get_current_version | ||
run: echo "::set-output name=current_version::$(jq -r '.version' package.json)" | ||
|
||
- name: Compare versions | ||
id: compare_versions | ||
run: | | ||
if [[ "${{ steps.get_prev_version.outputs.prev_version }}" != "${{ steps.get_current_version.outputs.current_version }}" ]]; then | ||
echo "Version changed. Creating Pre-Release." | ||
echo "::set-output name=version_changed::true" | ||
else | ||
echo "Version unchanged. No Pre-Release needed." | ||
echo "::set-output name=version_changed::false" | ||
fi | ||
- name: Create Pre-Release | ||
if: steps.compare_versions.outputs.version_changed == 'true' | ||
run: | | ||
# Create a new Pre-Release using GitHub API | ||
curl -X POST -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" https://api.github.com/repos/:owner/:repo/releases -d '{"tag_name": "v${{ steps.get_current_version.outputs.current_version }}", "prerelease": true, "draft": false}' |
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 |
---|---|---|
@@ -1,7 +1,9 @@ | ||
name: Build and push Docker image | ||
|
||
on: | ||
push: | ||
push: | ||
branches: | ||
- v3-alpha | ||
|
||
env: | ||
REGISTRY: ghcr.io | ||
|
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
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
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
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 |
---|---|---|
|
@@ -54,6 +54,8 @@ | |
<span class="ml-2">Please wait...</span> | ||
</div> | ||
|
||
{% include 'templates/update.html' %} | ||
|
||
</body> | ||
|
||
</html> |
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 |
---|---|---|
|
@@ -54,6 +54,8 @@ | |
<span class="ml-2">Please wait...</span> | ||
</div> | ||
|
||
{% include 'templates/update.html' %} | ||
|
||
</body> | ||
|
||
</html> |
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 |
---|---|---|
@@ -1,23 +1,23 @@ | ||
<div class="z-50 fixed left-0 bottom-0 p-4 "> | ||
<a href="https://github.com/wizarrrr/wizarr"> | ||
<div class="w-full max-w-xl p-6 mt-auto ml-auto bg-slate-700 rounded "> | ||
<div class="flex items-start justify-between -mx-2"> | ||
<div class="flex items-start px-2"> | ||
<span class="flex-shrink-0"> | ||
<svg width="24" height="21" viewBox="0 0 24 21" fill="none" xmlns="http://www.w3.org/2000/svg"> | ||
<path d="M12.0005 15C11.8027 15 11.6093 15.0587 11.4449 15.1686C11.2804 15.2784 11.1523 15.4346 11.0766 15.6173C11.0009 15.8001 10.9811 16.0011 11.0197 16.1951C11.0583 16.3891 11.1535 16.5673 11.2933 16.7071C11.4332 16.847 11.6114 16.9422 11.8054 16.9808C11.9993 17.0194 12.2004 16.9996 12.3831 16.9239C12.5659 16.8482 12.722 16.72 12.8319 16.5556C12.9418 16.3911 13.0005 16.1978 13.0005 16C13.0005 15.7348 12.8951 15.4805 12.7076 15.2929C12.52 15.1054 12.2657 15 12.0005 15ZM22.6705 16.47L14.6205 2.47003C14.3603 2.00354 13.9802 1.61498 13.5196 1.3445C13.0591 1.07401 12.5346 0.931396 12.0005 0.931396C11.4663 0.931396 10.9419 1.07401 10.4813 1.3445C10.0207 1.61498 9.64065 2.00354 9.38046 2.47003L1.38046 16.47C1.11125 16.924 0.966598 17.441 0.9611 17.9688C0.955602 18.4966 1.08945 19.0166 1.34914 19.4761C1.60883 19.9356 1.98516 20.3185 2.44014 20.5861C2.89512 20.8536 3.41264 20.9964 3.94046 21H20.0605C20.5925 21.0053 21.1164 20.8689 21.5784 20.6049C22.0403 20.341 22.4238 19.9589 22.6894 19.4978C22.9551 19.0368 23.0933 18.5134 23.09 17.9814C23.0866 17.4493 22.9418 16.9277 22.6705 16.47ZM20.9405 18.47C20.8528 18.626 20.7249 18.7556 20.5701 18.8453C20.4154 18.935 20.2393 18.9815 20.0605 18.98H3.94046C3.76157 18.9815 3.58556 18.935 3.43077 18.8453C3.27599 18.7556 3.14811 18.626 3.06046 18.47C2.97269 18.318 2.92648 18.1456 2.92648 17.97C2.92648 17.7945 2.97269 17.622 3.06046 17.47L11.0605 3.47003C11.1444 3.30623 11.2719 3.16876 11.4289 3.07277C11.5859 2.97678 11.7664 2.92599 11.9505 2.92599C12.1345 2.92599 12.315 2.97678 12.472 3.07277C12.629 3.16876 12.7565 3.30623 12.8405 3.47003L20.8905 17.47C20.9897 17.6199 21.0467 17.7937 21.0555 17.9732C21.0643 18.1527 21.0245 18.3312 20.9405 18.49V18.47ZM12.0005 7.00003C11.7352 7.00003 11.4809 7.10538 11.2933 7.29292C11.1058 7.48046 11.0005 7.73481 11.0005 8.00003V12C11.0005 12.2652 11.1058 12.5196 11.2933 12.7071C11.4809 12.8947 11.7352 13 12.0005 13C12.2657 13 12.52 12.8947 12.7076 12.7071C12.8951 12.5196 13.0005 12.2652 13.0005 12V8.00003C13.0005 7.73481 12.8951 7.48046 12.7076 7.29292C12.52 7.10538 12.2657 7.00003 12.0005 7.00003Z" fill="#FFC107"></path> | ||
</svg> | ||
</span> | ||
<div class="ml-2"> | ||
<h5 class="text-gray-100 font-semibold">{{ | ||
_("Attention!") }}</h5> | ||
<span class="text-xs font-medium text-gray-300">{{ _("Update available. Click here.") }}</span> | ||
</div> | ||
<div id="update-needed" class="z-50 absolute inset-0 flex items-center justify-center bg-gray-700 transition-opacity text-white flex flex-col space-y-2 {% if not APP_UPDATE %}hidden{% endif %}"> | ||
<div class="flex flex-col items-center justify-center w-full md:w-2/3 lg:w-4/12 py-8 md:mx-auto md:container px-2 sm:px-4 md:px-0"> | ||
<div class="relative w-full bg-white rounded shadow dark:border dark:bg-gray-800 dark:border-gray-700"> | ||
<div class="p-6 space-y-4 sm:p-8 text-gray-900 dark:text-white"> | ||
<span class="flex justify-center"> | ||
<i class="fas fa-exclamation-triangle text-5xl text-yellow-400"></i> | ||
</span> | ||
<div class="flex flex-col items-center justify-center space-y-1"> | ||
<h1 class="text-3xl font-semibold text-center text-gray-900 dark:text-white">{{ _("Update Required") }}</h1> | ||
<p class="text-center">{{ _("Wizarr requires an update before you can continue.") }}</p> | ||
</div> | ||
<div class="px-2"> | ||
|
||
<div class="flex justify-center mt-6 space-x-2"> | ||
<button onclick="window.location.reload()" class="bg-primary hover:bg-primary_hover focus:outline-none text-white font-medium rounded px-5 py-2.5 text-sm dark:bg-primary dark:hover:bg-primary_hover">{{ _("Reload") }}</button> | ||
</div> | ||
<span class="flex justify-center" style="margin-top: 10px"> | ||
<button id="ignoreUpdate" onclick="document.getElementById('update-needed').classList.add('hidden')" class="text-sm text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-300"> | ||
{{ _("Ignore") }} | ||
</button> | ||
</span> | ||
</div> | ||
</div> | ||
</a> | ||
</div> | ||
</div> |
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
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