Skip to content

Commit

Permalink
Create publish.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
CristiCanizales authored Sep 29, 2022
1 parent 94ed31f commit 2559a9f
Showing 1 changed file with 95 additions and 0 deletions.
95 changes: 95 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
name: Publish Beta Release to Github Only

on:
workflow_dispatch:

jobs:
save_artifacts:
name: 'Build VSIX Files'
runs-on: ubuntu-latest

steps:
- uses: actions/setup-node@v1
with:
node-version: '16.13.x'
- uses: actions/checkout@v3
with:
ref: ${{ github.event.ref }}
- run: npm install -g lerna
- run: npm install
- run: npm run compile
- run: npm run vscode:package
- name: Stage Artifacts
run: |
mkdir extensions
find packages -name "*.vsix" -type f -exec cp {} ./extensions \;
cp ./packages/salesforcedx-vscode/CHANGELOG.md ./extensions
- name: Upload Extensions
uses: actions/upload-artifact@v3
with:
name: VS Code Extensions
path: ./extensions/

get_release_variables:
# store the RELEASE_VERSION from the parent package as an output that we can reference elsewhere
name: 'Get Release Environment Variables'
runs-on: ubuntu-latest
outputs:
RELEASE_VERSION: ${{ steps.getVersion.outputs.version }}
steps:
- uses: actions/checkout@v3
- id: getVersion
run: echo "::set-output name=version::"$(node -pe "require('./packages/salesforcedx-vscode/package.json').version")""
- run: echo "Release Version is ${{ steps.getVersion.outputs.version }}"

create_git_tag:
name: 'Create and Tag Beta Release'
runs-on: ubuntu-latest
needs: [save_artifacts, get_release_variables]
env:
VERSION: ${{ needs.get_release_variables.outputs.RELEASE_VERSION }}

steps:
- uses: actions/checkout@v3
- uses: actions/download-artifact@v3
id: download
with:
name: VS Code Extensions
path: tmp/saved-extensions
- uses: ./.github/actions/gitConfig
with:
email: ${{ secrets.GH_EMAIL }}
- name: 'Create git tag to map to the Release Version'
run: |
git tag v${{ env.VERSION }}
git push origin v${{ env.VERSION }}
- name: 'Confirm all downloaded files'
run: ls -R
working-directory: tmp/saved-extensions
- name: 'Create Pre-Release and Attach VSIX Files'
run: gh release create v${{ env.VERSION }} **.vsix --title "Pre-Release v${{ env.VERSION }}" --notes-file CHANGELOG.md --prerelease
working-directory: tmp/saved-extensions
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

# "notify" workflow for slack notification
notify:
name: 'Github notification for Beta Release'
runs-on: ubuntu-latest
needs: [create_git_tag]

steps:
- name: Creation successful
id: slack
uses: slackapi/[email protected]
with:
# This data can be any valid JSON from a previous step in the GitHub Action
payload: |
{
"title": "Test - Beta release",
"project": "salesforcedx-apex",
"job_number": "5731",
"workflow_url": "https://app.circleci.com/pipelines/github/forcedotcom/salesforcedx-apex/1410/workflows/d05b609f-85fa-41ba-aa4b-ca6374c13dfb"
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.IDEE_RELEASE_ALERT_SLACK_WEBHOOK }}

0 comments on commit 2559a9f

Please sign in to comment.