Repository navigation
pre-release #438
This file contains hidden or 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
| 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 |