Skip to content

fix: remove explicit npm token usage during release (#1344) #184

fix: remove explicit npm token usage during release (#1344)

fix: remove explicit npm token usage during release (#1344) #184

Workflow file for this run

name: Stencil CLI Release
on:
push:
branches: [master, main]
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write # to be able to publish a GitHub release
issues: write # to be able to comment on released issues
pull-requests: write # to be able to comment on released pull requests
id-token: write # to enable use of OIDC for trusted publishing and npm provenance
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '22.x'
- run: npm i
- name: Check Git Commit name
run: git log -1 --pretty=format:"%s" | npx commitlint
- name: Deploy to npm and git
run: npm config list && npm run release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GA_USERNAME: ${{ secrets.PAT_USERNAME }}
GA_TOKEN: ${{ secrets.PAT_TOKEN }}
- name: Get latest Git tag
id: tag
run: |
git fetch --tags
TAG=$(git describe --tags --abbrev=0)
echo "tag=$TAG" >> $GITHUB_OUTPUT
- name: Log in to the Github Container registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{ github.repository_owner }}/stencil-cli
tags: |
type=semver,pattern={{version}},prefix=,value=${{ steps.tag.outputs.tag }}
type=semver,pattern={{major}},prefix=,value=${{ steps.tag.outputs.tag }}
type=semver,pattern={{major}}.{{minor}},prefix=,value=${{ steps.tag.outputs.tag }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build and push
uses: docker/build-push-action@v6
with:
push: true
tags: ${{ steps.meta.outputs.tags }}