attempt to release in npm-js #50
This file contains 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: "release-sass" | |
on: | |
push: | |
branches: | |
- dev | |
- master | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout current branch | |
uses: actions/checkout@v4 | |
- name: "Setup Node" | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 21 | |
registry-url: 'https://registry.npmjs.org' | |
- name: "Install npm dependencies" | |
run: npm ci | |
- name: "Building SASS files" | |
run: npm run sass | |
- name: Set up Git Config | |
run: | | |
git config user.email "actions@github.com" | |
git config user.name "GitHub Actions" | |
- name: commit built sass | |
uses: actions-x/commit@v6 | |
with: | |
email: actions@github.com | |
name: Autocommiting Built CSS | |
files: ./dist/* package.json | |
token: ${{ secrets.MY_SECRET_TOKEN }} | |
force: true | |
- name: "Mark prelelease" | |
if: github.ref == 'refs/heads/dev' | |
run: | | |
npm version prerelease --preid=dev --no-commit-hooks --no-git-tag-version | |
- name: commit built package.json | |
if: github.ref == 'refs/heads/dev' | |
uses: actions-x/commit@v6 | |
with: | |
email: actions@github.com | |
name: Mark Release as prerelease for npm | |
files: package.json | |
token: ${{ secrets.MY_SECRET_TOKEN }} | |
force: true | |
- name: version | |
id: version | |
run: | | |
echo version=$(npm run version --silent) >> "$GITHUB_OUTPUT" | |
- name: Tag version | |
id: tag_version | |
# if: github.ref == 'refs/heads/master' | |
uses: mathieudutour/github-tag-action@v6.1 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
custom_tag: ${{ steps.version.outputs.version }} | |
- name: Make Css zip | |
run: | | |
zip -r cssonly.zip ./dist/*.css | |
- uses: "marvinpinto/action-automatic-releases@latest" | |
if: github.ref == 'refs/heads/dev' | |
with: | |
repo_token: "${{ secrets.GITHUB_TOKEN }}" | |
automatic_release_tag: "v${{ steps.version.outputs.version }}" | |
prerelease: true | |
title: "Development Build" | |
files: | | |
cssonly.zip | |
- uses: "marvinpinto/action-automatic-releases@latest" | |
if: github.ref == 'refs/heads/master' | |
with: | |
repo_token: "${{ secrets.GITHUB_TOKEN }}" | |
automatic_release_tag: "v${{ steps.version.outputs.version }}" | |
prerelease: false | |
title: "Release ${{ steps.version.outputs.version }}" | |
files: | | |
cssonly.zip | |
- id: npm-publish | |
name: publish into npmjs | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPMJS_ACCESS_KEY }} | |
run: | |
npm publish |