Skip to content

Commit

Permalink
ci: update the release config using --dry-run to test
Browse files Browse the repository at this point in the history
  • Loading branch information
BlueCutOfficial committed Apr 27, 2023
1 parent 3b940d1 commit 18d0d6b
Show file tree
Hide file tree
Showing 3 changed files with 67 additions and 19 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
run: yarn build

- name: Run Tests
run: yarn test
run: yarn test:ember

floating:
name: Floating Dependencies
Expand Down Expand Up @@ -82,8 +82,8 @@ jobs:
- ember-lts-3.28
- ember-lts-4.4
- ember-release
- ember-beta
- ember-canary
# - ember-beta
# - ember-canary
- ember-classic
- embroider-safe
- embroider-optimized
Expand Down
78 changes: 63 additions & 15 deletions .github/workflows/tag-release-publish.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,75 @@
# GitHub Actions documentation:
# https://docs.github.com/en/actions

name: Create new `git tag`, create new GitHub release and publish to NPM
name: Create new tag, create new GitHub release and publish to NPM

on:
workflow_run:
workflows:
- CI
branches:
- master
types:
- completed
pull_request: {}

concurrency:
group: tag-release-publish-${{ github.ref }}
cancel-in-progress: true

jobs:
org:
create_git_tag:
if: ${{ github.event.workflow_run.conclusion == 'success' }}
uses: DazzlingFugu/.github/.github/workflows/js--tag-release-publish.yml@master
with:
node-version: 16
package-manager: yarn
secrets:
npm-automation-token: ${{ secrets.NPM_AUTOMATION_TOKEN }}
name: Create new tag
runs-on: ubuntu-latest
timeout-minutes: 20
outputs:
new_tag: ${{ steps.detect_then_tag.outputs.tag }}
new_version: ${{ steps.detect_then_tag.outputs.current-version }}
old_version: ${{ steps.detect_then_tag.outputs.previous-version }}
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 2

- name: Detect and tag new version
id: detect_then_tag
uses: salsify/action-detect-and-tag-new-version@v2

create_github_release:
if: ${{ needs.create_git_tag.outputs.new_tag }}
name: Create new GitHub release
needs: create_git_tag
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: ncipollo/release-action@v1
with:
body: "\
Changelog: \
${{ github.server_url }}/${{ github.repository }}\
/compare/\
v${{ needs.create_git_tag.outputs.old_version }}...v${{ needs.create_git_tag.outputs.new_version }}\
"
name: Release ${{ needs.create_git_tag.outputs.new_tag }}
tag: ${{ needs.create_git_tag.outputs.new_tag }}

publish_npm:
name: Publish to NPM
needs: create_github_release
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Set up Node.js
uses: actions/setup-node@v3
with:
cache: 'yarn'
node-version: 16
registry-url: https://registry.npmjs.org

- name: Install Dependencies
run: yarn install --frozen-lockfile
working-directory: ember-slugify

- name: Publish to NPM
run: npm publish --dry-run
working-directory: ember-slugify
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTOMATION_TOKEN }}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@
"lint:fix": "yarn workspaces run lint:fix",
"start:addon": "yarn workspace ember-slugify run start",
"start:test-app": "yarn workspace test-app run start",
"test": "yarn workspace test-app test"
"test:ember": "yarn workspace test-app test:ember"
}
}

0 comments on commit 18d0d6b

Please sign in to comment.