-
Notifications
You must be signed in to change notification settings - Fork 47
67 lines (62 loc) · 2.27 KB
/
version-check.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
name: "Version check for NEW release"
run-name: " Version check for NEW release ${{ inputs.DEPLOY_TARGET }} by @${{ github.ACTOR }}"
on:
workflow_dispatch:
push:
branches:
- master
schedule:
- cron: "*/30 * * * *"
permissions:
contents: write
jobs:
pull-request:
concurrency:
group: check-for-new-versions
cancel-in-progress: false
runs-on: ubuntu-latest
env:
REPO_UNLEASHED: ${{ vars.REPO_UNLEASHED }}
CURRENT_TAG: ${{ vars.FIRMWARE_VERSION }}
REMOTE_TAG_INFO: ''
RELEASE_VERSION: ${{ vars.RELEASE_VERSION }}
FIRMWARE_VERSION: ${{ vars.FIRMWARE_VERSION }}
REPO_SELF: ${{ vars.REPO_SELF }}
CHECKOUT_DIR: "firmware"
RELEASE_TYPE: 0
steps:
- name: Copy Repo Files
uses: actions/checkout@v3
with:
repository: "${{ env.REPO_SELF }}"
clean: "true"
submodules: "true"
token: ${{ secrets.FLIPPER_TOKEN }}
- name: Check firmware release
shell: pwsh
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
./.github/check-version.ps1 '${{ env.FIRMWARE_VERSION }}' '${{ env.RELEASE_VERSION }}' '${{ env.REPO_SELF }}' '${{ env.REPO_UNLEASHED }}' | %{ Write-Output($_) >> $Env:GITHUB_ENV }
- name: Print env values
run: env
- name: Create release if necessary
if: ${{ success() && (env.RELEASE_TYPE == 2 || env.RELEASE_TYPE == 1 )}}
uses: ./.github/actions/make-release
with:
gh_token: ${{ secrets.FLIPPER_TOKEN }}
release_type: ${{ env.RELEASE_TYPE }}
release_version: ${{ env.RELEASE_VERSION }}
firmware_version: ${{ env.REMOTE_TAG_INFO }}
repo_self: ${{ env.REPO_SELF }}
owner: ${{ github.repository_owner }}
current_tag: ${{ env.CURRENT_TAG }}
remote_tag_info: ${{ env.REMOTE_TAG_INFO }}
- name: Current settings in repo invalid. Changing
if: ${{ success() && env.RELEASE_TYPE > 2 }}
env:
GITHUB_TOKEN: ${{ secrets.FLIPPER_TOKEN }}
OWNER: ${{ github.repository_owner }}
run: |
gh variable set RELEASE_VERSION -b ${{ env.RELEASE_VERSION }} -R ${{ env.REPO_SELF }}
# EOF