Skip to content

Commit

Permalink
Update publish.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
Tatsinnit authored Mar 22, 2024
1 parent 13bf4f6 commit eef76ba
Showing 1 changed file with 53 additions and 58 deletions.
111 changes: 53 additions & 58 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,64 +5,59 @@ permissions:
contents: read

jobs:
build:
name: release
JobBuild:
name: release
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
deployments: read
packages: none
steps:
- name: Harden Runner
uses: step-security/harden-runner@63c24ba6bd7ba022e95695ff85de572c04a18142 # v2.7.0
with:
egress-policy: audit

- name: Checkout
uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
- name: Use Node.js
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
with:
node-version: 20
# Run install dependencies
- name: Install dependencies
run: npm run install:all
# Ensure project builds successfully before creating release
- name: Build
run: npm run webpack
- name: Get current package version
id: package_version
uses: martinbeentjes/npm-get-version-action@3cf273023a0dda27efcd3164bdfb51908dd46a5b # v1.3.1

JobsPublish:
name: publish
runs-on: ubuntu-latest
needs: JobBuild
permissions:
actions: read
contents: write
deployments: read
packages: none
actions: read
contents: write
deployments: read
packages: none
steps:
- name: Harden Runner
uses: step-security/harden-runner@63c24ba6bd7ba022e95695ff85de572c04a18142 # v2.7.0
with:
egress-policy: audit

- name: Checkout
uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
- name: Use Node.js
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
with:
node-version: 20
# Run install dependencies
- name: Install dependencies
run: npm run install:all
# Ensure project builds successfully before creating release
- name: Build
run: npm run webpack
- name: Get current package version
id: package_version
uses: martinbeentjes/npm-get-version-action@3cf273023a0dda27efcd3164bdfb51908dd46a5b # v1.3.1
- name: Check version is mentioned in Changelog
id: changelog_reader
uses: mindsers/changelog-reader-action@32aa5b4c155d76c94e4ec883a223c947b2f02656 # v2.2.3
with:
validation_depth: 10
version: ${{ steps.package_version.outputs.current-version }}
path: 'CHANGELOG.md'
- name: Create a Release
id: create_release
uses: actions/create-release@0cb9c9b65d5d1901c1f53e5e66eaf4afd303e70e # v1.1.4
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name : ${{ steps.package_version.outputs.current-version}}
release_name: ${{ steps.package_version.outputs.current-version}}
body: Publish ${{ steps.changelog_reader.outputs.changes }}
- name: Create vsix and publish to marketplace
id: create_vsix
uses: HaaLeo/publish-vscode-extension@28e2d3f5817fccf23c1f219eb0cecc903132d1a2 # v1.6.2
with:
pat: ${{ secrets.VS_MARKETPLACE_TOKEN }}
registryUrl: https://marketplace.visualstudio.com
- name: Attach vsix to release
uses: actions/upload-release-asset@e8f9f06c4b078e705bd2ea027f0926603fc9b4d5 # v1.0.2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ${{ steps.create_vsix.outputs.vsixPath}}
asset_name: ${{ steps.create_vsix.outputs.vsixPath}}
asset_content_type: application/vsix

- name: Check version is mentioned in Changelog
id: changelog_reader
uses: mindsers/changelog-reader-action@32aa5b4c155d76c94e4ec883a223c947b2f02656 # v2.2.3
with:
validation_depth: 10
version: ${{ steps.JobBuild.outputs.package_version }}
path: 'CHANGELOG.md'
- name: Create a Release
id: create_release
uses: actions/create-release@0cb9c9b65d5d1901c1f53e5e66eaf4afd303e70e # v1.1.4
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name : ${{ needs.JobBuild.outputs.package_version }}
release_name: ${{ steps.JobBuild.outputs.current-version}}
body: Publish ${{ steps.changelog_reader.outputs.changes }}

0 comments on commit eef76ba

Please sign in to comment.