Skip to content

Commit

Permalink
fix: ensure dist folder matches release (#83)
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanbuck authored Dec 28, 2024
1 parent aff753a commit 5561b47
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 14 deletions.
35 changes: 23 additions & 12 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,28 +1,39 @@
name: release

on:
push:
branches:
- main

permissions:
contents: write
issues: write
pull-requests: write

jobs:
release:
name: release
runs-on: ubuntu-latest
steps:
# build local version to create token
- uses: actions/checkout@v4
with:
persist-credentials: false

- uses: actions/setup-node@v4
with:
node-version: '20'
node-version-file: .node-version
cache: 'npm'

- run: npm ci
- run: npm run build
- run: rm .gitignore # dist/ folder is ignored by default
- run: |
git config user.name github-actions
git config user.email [email protected]
git add .gitignore dist/
git commit -m "build"
git push --force https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git HEAD:refs/heads/v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- run: npx semantic-release
- uses: actions/create-github-app-token@v1
id: app-token
with:
app-id: ${{ vars.RELEASER_APP_ID }}
private-key: ${{ secrets.RELEASER_APP_PRIVATE_KEY }}
# install release dependencies and release
- run: npm install --no-save @semantic-release/git semantic-release-plugin-github-breaking-version-tag
- run: npx semantic-release --debug
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
dist
node_modules/
node_modules/
1 change: 1 addition & 0 deletions .node-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
20
18 changes: 18 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,25 @@
},
"release": {
"branches": [
"+([0-9]).x",
"main"
],
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
"@semantic-release/github",
"@semantic-release/npm",
"semantic-release-plugin-github-breaking-version-tag",
[
"@semantic-release/git",
{
"assets": [
"package.json",
"dist/*"
],
"message": "build(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
}
]
]
}
}

0 comments on commit 5561b47

Please sign in to comment.