Repository navigation
59 lines (56 loc) · 2.26 KB
/
Copy pathdeploy-develop.yml
File metadata and controls
59 lines (56 loc) · 2.26 KB
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
name: Publish development binaries
on:
push:
branches: [main]
workflow_dispatch:
permissions:
contents: read
jobs:
build:
uses: ./.github/workflows/build.yml
release:
needs: build
runs-on: windows-2022
permissions:
actions: read
contents: write
concurrency:
group: publish-Develop
cancel-in-progress: false
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
with:
ref: ${{ github.workflow_sha }}
persist-credentials: false
sparse-checkout: .github/scripts
- name: Prepare allowlisted artifact bytes
env:
GH_TOKEN: ${{ github.token }}
RELEASE_VERSION: Develop
RELEASE_COMMIT: ${{ github.sha }}
run: python -I .github\scripts\release_artifacts.py
- name: Publish tested development binaries
env:
GH_TOKEN: ${{ github.token }}
GH_REPO: ${{ github.repository }}
RELEASE_COMMIT: ${{ github.sha }}
run: |
if ($env:GITHUB_EVENT_NAME -eq "push") {
$current = gh api "repos/$env:GH_REPO/git/ref/heads/main" --jq .object.sha
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
if ($current -ne $env:RELEASE_COMMIT) {
Write-Host "Skipping superseded main build $env:RELEASE_COMMIT"
exit 0
}
}
$release = gh api --paginate "repos/$env:GH_REPO/releases?per_page=100" --jq '.[] | select(.tag_name == "Develop") | .id'
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
$notes = "Development binaries from $env:RELEASE_COMMIT. Verify both assets against provenance.json; the historical Develop tag is not moved."
if ($release) {
gh release upload Develop release-binaries\pd32.exe release-binaries\pd64.exe release-binaries\provenance.json --clobber
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
gh release edit Develop --notes $notes
} else {
gh release create Develop release-binaries\pd32.exe release-binaries\pd64.exe release-binaries\provenance.json --target $env:RELEASE_COMMIT --title Develop --prerelease --notes $notes
}
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }