catppuccin-palette/.github/workflows/release-please.yml

65 lines
1.8 KiB
YAML
Raw Normal View History

2023-12-28 10:43:11 +00:00
name: Release Please
2023-07-10 02:28:41 +00:00
on:
push:
branches: [main]
2023-12-28 10:57:09 +00:00
workflow_dispatch:
inputs:
force_release:
description: Force a release
required: true
type: boolean
2023-12-28 10:59:12 +00:00
force_release_version:
description: Version of the release
required: false
type: string
2023-07-10 02:28:41 +00:00
2023-12-28 10:47:40 +00:00
permissions:
contents: write
id-token: write
pull-requests: write
2023-07-10 02:28:41 +00:00
jobs:
release-please:
runs-on: ubuntu-latest
steps:
2023-12-28 10:43:11 +00:00
- uses: google-github-actions/release-please-action@v4
id: release
outputs:
release_created: ${{ steps.release.outputs.release_created }}
tag_name: ${{ steps.release.outputs.tag_name }}
release:
runs-on: ubuntu-latest
needs: release-please
2023-12-28 10:57:09 +00:00
if: ${{ needs.release-please.outputs.release_created || github.event.inputs.force_release }}
2023-12-28 10:43:11 +00:00
steps:
- uses: actions/checkout@v4
- uses: nekowinston/setup-deno@v1
2023-12-28 10:51:50 +00:00
- uses: actions/setup-node@v4
2023-07-10 02:28:41 +00:00
with:
2023-12-28 10:43:11 +00:00
node-version: "lts/*"
registry-url: "https://registry.npmjs.org"
- name: Build
run: deno task build
- name: Publish NPM package
working-directory: dist/npm
run: npm publish --provenance --access public
2023-07-10 02:28:41 +00:00
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
2023-12-28 10:43:11 +00:00
- name: Upload the palette files
2023-12-28 11:03:28 +00:00
env:
GH_TOKEN: ${{ github.token }}
2023-12-28 10:43:11 +00:00
run: |
2024-01-02 19:50:07 +00:00
echo "Creating tarball"
tar cvzf catppuccin.tar.gz --directory=dist/palettes/ . || exit 1
echo "Creating zip"
pushd dist/palettes && zip -r "$GITHUB_WORKSPACE/catppuccin.zip" ./* && popd || exit 1
echo "Uploading release assets"
gh release upload ${{ needs.release-please.outputs.tag_name || inputs.force_release_version }} catppuccin.zip catppuccin.tar.gz --clobber