use bun as package manager and runner for the docke rcontainer, plus some tweak on the github action

This commit is contained in:
Platane
2025-02-20 19:34:18 +07:00
committed by GitHub
parent 74bc4f0651
commit 85da3901f5
29 changed files with 25796 additions and 10209 deletions

View File

@@ -8,15 +8,13 @@ jobs:
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
cache: yarn
node-version: 20
- run: yarn install --frozen-lockfile
- uses: oven-sh/setup-bun@v1
- run: bun install --frozen-lockfile
- run: npm run type
- run: npm run lint
- run: npm run test --ci
- run: bun test
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -46,7 +44,7 @@ jobs:
test -f dist/github-contribution-grid-snake-dark.svg
test -f dist/github-contribution-grid-snake.gif
- uses: crazy-max/ghaction-github-pages@v3.1.0
- uses: crazy-max/ghaction-github-pages@v4.1.0
with:
target_branch: output
build_dir: dist
@@ -57,11 +55,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
cache: yarn
node-version: 20
- run: yarn install --frozen-lockfile
- uses: oven-sh/setup-bun@v1
- run: bun install --frozen-lockfile
- name: build svg-only action
run: |
@@ -84,7 +80,7 @@ jobs:
test -f dist/github-contribution-grid-snake.svg
test -f dist/github-contribution-grid-snake-dark.svg
- uses: crazy-max/ghaction-github-pages@v3.1.0
- uses: crazy-max/ghaction-github-pages@v4.1.0
with:
target_branch: output-svg-only
build_dir: dist
@@ -93,22 +89,22 @@ jobs:
deploy-ghpages:
runs-on: ubuntu-latest
permissions:
pages: write
id-token: write
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
cache: yarn
node-version: 20
- run: yarn install --frozen-lockfile
- uses: oven-sh/setup-bun@v1
- run: bun install --frozen-lockfile
- run: npm run build:demo
env:
GITHUB_USER_CONTRIBUTION_API_ENDPOINT: https://snk-one.vercel.app/api/github-user-contribution/
- uses: crazy-max/ghaction-github-pages@v3.1.0
if: success() && github.ref == 'refs/heads/main'
- uses: actions/upload-pages-artifact@v3
with:
target_branch: gh-pages
build_dir: packages/demo/dist
env:
GITHUB_TOKEN: ${{ secrets.MY_GITHUB_TOKEN_GH_PAGES }}
path: packages/demo/dist
- uses: actions/deploy-pages@v4
if: success() && github.ref == 'refs/heads/main'

View File

@@ -37,9 +37,7 @@ jobs:
test -f dist/docker/github-contribution-grid-snake.gif
- name: push github-contribution-grid-snake.svg to the output branch
uses: crazy-max/ghaction-github-pages@v3.1.0
uses: crazy-max/ghaction-github-pages@v4.1.0
with:
target_branch: manual-run-output
build_dir: dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

View File

@@ -45,20 +45,18 @@ jobs:
run: |
sed -i "s/image: .*/image: docker:\/\/platane\/snk@${{ steps.docker-build.outputs.digest }}/" action.yml
- uses: actions/setup-node@v3
with:
cache: yarn
node-version: 20
- uses: oven-sh/setup-bun@v1
- run: bun install --frozen-lockfile
- name: build svg-only action
run: |
yarn install --frozen-lockfile
npm run build:action
rm -r svg-only/dist
mv packages/action/dist svg-only/dist
- name: bump package version
run: yarn version --no-git-tag-version --new-version ${{ github.event.inputs.version }}
run: npm version --no-git-tag-version --new-version ${{ github.event.inputs.version }}
- name: push new build, tag version and push
id: push-tags
@@ -77,13 +75,11 @@ jobs:
git tag v$( echo $VERSION | cut -d. -f 1-2 )
git push origin --tags --force
echo "prerelease=false" >> $GITHUB_OUTPUT
else
else
echo "prerelease=true" >> $GITHUB_OUTPUT
fi
- uses: ncipollo/release-action@v1.12.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: ncipollo/release-action@v1.15.0
with:
tag: v${{ github.event.inputs.version }}
body: ${{ github.event.inputs.description }}