-
Notifications
You must be signed in to change notification settings - Fork 0
Fiddle: corrections for deployment #19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,20 +1,23 @@ | ||
| name: Deploy | ||
| name: Deploy Package | ||
| on: | ||
| push: | ||
| branches: [main] | ||
| tags: ["v*"] | ||
| workflow_dispatch: | ||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.ref }}-deploy | ||
| cancel-in-progress: false | ||
| jobs: | ||
| deploy-package-next: | ||
| deploy-package: | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: read | ||
| id-token: write # Required for OIDC authentication with npm | ||
| env: | ||
| DOCKER_IMAGE: package | ||
| NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
| steps: | ||
| - name: Check out the repo | ||
| uses: actions/checkout@v2 | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| # NOTE(krishan711): need full history to calculate difference | ||
| fetch-depth: 0 | ||
|
|
@@ -31,8 +34,37 @@ jobs: | |
| - name: Calculate commit count since last tag | ||
| id: vars | ||
| run: echo ::set-output name=commit_count::$(git rev-list $(git describe --tags --abbrev=0)..HEAD --count) | ||
| - name: Create .npmrc file | ||
| run: echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > .npmrc | ||
| - name: Extract built package from Docker | ||
| run: | | ||
| docker create --name temp-container $DOCKER_IMAGE | ||
| docker cp temp-container:/app/. ./ | ||
| docker rm temp-container | ||
|
Comment on lines
+37
to
+41
|
||
| - name: Setup Node.js | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: '20' | ||
| registry-url: 'https://registry.npmjs.org' | ||
| - name: Update npm to latest | ||
| run: npm install -g npm@latest | ||
| - name: Publish next package to npm | ||
| if: steps.vars.outputs.commit_count != '0' | ||
| run: docker run -v $(pwd)/.npmrc:/root/.npmrc $DOCKER_IMAGE make NEXT_VERSION=${{ steps.vars.outputs.commit_count }} publish-next | ||
| if: steps.vars.outputs.commit_count != '0' && github.ref == 'refs/heads/main' | ||
| run: npx kiba-publish --next --next-version ${{ steps.vars.outputs.commit_count }} | ||
|
Comment on lines
49
to
+51
|
||
| - name: Publish package to npm | ||
| if: startsWith(github.ref, 'refs/tags/v') | ||
| run: npm publish | ||
|
Comment on lines
+52
to
+54
|
||
| create-release: | ||
| needs: deploy-package | ||
| if: startsWith(github.ref, 'refs/tags/v') | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: write | ||
| steps: | ||
| - name: Check out the repo | ||
| uses: actions/checkout@v4 | ||
| - name: Create Release | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| run: | | ||
| gh release create ${{ github.ref_name }} \ | ||
| --title "Release ${{ github.ref_name }}" \ | ||
| --generate-notes | ||
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
set-outputcommand using::set-outputsyntax is deprecated and will be disabled in future GitHub Actions runners. This should be updated to use the modern syntax by writing to the $GITHUB_OUTPUT environment file instead.