mirror of
https://github.com/Slava-Shchipunov/awg-openwrt.git
synced 2026-03-19 19:35:48 +00:00
Merge pull request #8 from Slava-Shchipunov/feat/update-gh-actions
Feat/update gh actions
This commit is contained in:
48
.github/workflows/run-release.yml
vendored
Normal file
48
.github/workflows/run-release.yml
vendored
Normal file
@@ -0,0 +1,48 @@
|
||||
name: Sync OpenWRT Releases
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: '0 0 */3 * *' # Проверка новых релизов раз в три дня
|
||||
workflow_dispatch: # Возможность вручную запустить Action
|
||||
|
||||
jobs:
|
||||
sync-releases:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout your repo
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Get the latest release from OpenWRT
|
||||
id: get_release
|
||||
run: |
|
||||
curl -s https://api.github.com/repos/openwrt/openwrt/releases/latest > latest_release.json
|
||||
RELEASE_TAG=$(jq -r .tag_name latest_release.json)
|
||||
RELEASE_NAME=$(jq -r .name latest_release.json)
|
||||
echo "::set-output name=release_tag::$RELEASE_TAG"
|
||||
echo "::set-output name=release_name::$RELEASE_NAME"
|
||||
|
||||
- name: Check if release exists in your repo
|
||||
id: check_release
|
||||
run: |
|
||||
curl -s https://api.github.com/repos/Slava-Shchipunov/awg-openwrt/releases/tags/${{ steps.get_release.outputs.release_tag }} | jq -r .tag_name || echo "Not found"
|
||||
|
||||
- name: Create release in your repo
|
||||
if: steps.check_release.outputs.tag_name == 'Not found'
|
||||
run: |
|
||||
ART="
|
||||
_______ ________ __
|
||||
| |.-----.-----.-----.| | | |.----.| |_
|
||||
| - || _ | -__| || | | || _|| _|
|
||||
|_______|| __|_____|__|__||________||__| |____|
|
||||
|__| A M N E Z I A W I R E G U A R D
|
||||
-----------------------------------------------------
|
||||
OpenWrt ${{ steps.get_release.outputs.release_tag }}
|
||||
-----------------------------------------------------"
|
||||
curl -X POST https://api.github.com/repos/Slava-Shchipunov/awg-openwrt/releases \
|
||||
-H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{
|
||||
"tag_name": "'${{ steps.get_release.outputs.release_tag }}'",
|
||||
"name": "Build amnezia wg for all devices with openwrt '${{ steps.get_release.outputs.release_tag }}'",
|
||||
"body": "'"${ART}"'\n\nAutomatically created release for OpenWRT '${{ steps.get_release.outputs.release_tag }}'."
|
||||
}'
|
||||
4
index.js
4
index.js
@@ -4,8 +4,8 @@ const core = require('@actions/core');
|
||||
|
||||
const version = process.argv[2]; // Получение версии OpenWRT из аргумента командной строки
|
||||
|
||||
// mediatek, ramips
|
||||
const SNAPSHOT_SUBTARGETS_TO_BUILD = ['filogic', 'mt7622', 'mt7623', 'mt7629', 'mt7620', 'mt7621', 'mt76x8'];
|
||||
// mediatek, ramips, x86, armsr
|
||||
const SNAPSHOT_SUBTARGETS_TO_BUILD = ['filogic', 'mt7622', 'mt7623', 'mt7629', 'mt7620', 'mt7621', 'mt76x8', '64', 'armv8'];
|
||||
|
||||
if (!version) {
|
||||
core.setFailed('Version argument is required');
|
||||
|
||||
Reference in New Issue
Block a user