Repository navigation
62 lines (57 loc) · 1.88 KB
/
Copy pathpre-release.yml
File metadata and controls
62 lines (57 loc) · 1.88 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
60
61
62
name: pre-release
# Update the development release only after the main workflow has passed.
on:
workflow_run:
workflows:
- main
branches:
- main
types:
- completed
concurrency:
group: pre-release
cancel-in-progress: true
permissions:
actions: read
contents: write
jobs:
pre-release:
name: Pre-Release
if: >-
github.event.workflow_run.conclusion == 'success' &&
github.event.workflow_run.event == 'push' &&
github.event.workflow_run.head_repository.full_name == github.repository
runs-on: ubuntu-latest
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
ref: ${{ github.event.workflow_run.head_sha }}
- name: Download artifacts
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: vscode-R.vsix
path: artifacts/
run-id: ${{ github.event.workflow_run.id }}
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Check main still points to the verified revision
id: current
env:
VERIFIED_SHA: ${{ github.event.workflow_run.head_sha }}
run: |
MAIN_SHA=$(git ls-remote origin refs/heads/main | cut -f1)
test -n "$MAIN_SHA"
if [ "$MAIN_SHA" = "$VERIFIED_SHA" ]; then
echo "publish=true" >> "$GITHUB_OUTPUT"
fi
- name: Create or update pre-release
if: steps.current.outputs.publish == 'true'
run: |
gh release delete latest --yes || true
git tag -f latest
git push origin latest --force
gh release create latest artifacts/vscode-R.vsix \
--title "Development Build" \
--notes "Contains the VSIX from the latest verified push to main." \
--prerelease