-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: use semantic-release directly
- Loading branch information
1 parent
0b15c74
commit f84a6bf
Showing
6 changed files
with
2,467 additions
and
210 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,136 @@ | ||
name: 'publish build to d2-ci' | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
tags: | ||
- '*' | ||
|
||
env: | ||
GIT_AUTHOR_NAME: '@dhis2-bot' | ||
GIT_AUTHOR_EMAIL: '[email protected]' | ||
GIT_COMMITTER_NAME: '@dhis2-bot' | ||
GIT_COMMITTER_EMAIL: '[email protected]' | ||
GH_TOKEN: ${{secrets.DHIS2_BOT_GITHUB_TOKEN}} | ||
CI: true | ||
|
||
jobs: | ||
publish-to-d2-ci: | ||
if: | | ||
${{ !github.event.push.repository.fork }} && | ||
${{ startsWith(github.ref, 'refs/tags/') || (github.ref == 'refs/heads/master' && contains(github.event.head_commit.message, '[skip release]')) }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18.x | ||
|
||
- name: Install | ||
run: yarn install --frozen-lockfile | ||
|
||
- name: Build | ||
run: yarn d2-app-scripts build | ||
|
||
- name: Copy build to d2-ci | ||
uses: dhis2/deploy-build@master | ||
with: | ||
build-dir: build/app | ||
github-token: ${{ secrets.DHIS2_BOT_GITHUB_TOKEN }} | ||
|
||
report-release-failure: | ||
runs-on: ubuntu-latest | ||
needs: publish-to-d2-ci | ||
if: ${{ failure() && !cancelled() }} | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@master | ||
|
||
- name: Extract version | ||
id: extract_version | ||
uses: Saionaro/[email protected] | ||
|
||
- name: Send failure message to analytics-internal-bot slack channel | ||
id: slack | ||
uses: slackapi/[email protected] | ||
with: | ||
channel-id: ${{ secrets.SLACK_CHANNEL_ID }} | ||
payload: | | ||
{ | ||
"text": ":small_red_triangle_down: :maps-app: Maps release <https://github.com/dhis2/maps-app/actions/workflows/dhis2-verify-app.yml?query=branch%3Amaster+is%3Afailure|failed>", | ||
"blocks": [ | ||
{ | ||
"type": "section", | ||
"text": { | ||
"type": "mrkdwn", | ||
"text": ":small_red_triangle_down: :maps-app: Maps release <https://github.com/dhis2/maps-app/actions/workflows/dhis2-verify-app.yml?query=branch%3Amaster+is%3Afailure|failed>" | ||
} | ||
} | ||
] | ||
} | ||
env: | ||
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} | ||
|
||
report-release-success: | ||
runs-on: ubuntu-latest | ||
needs: publish-to-d2-ci | ||
if: ${{ success() && !cancelled() && github.ref == 'refs/heads/master' }} | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@master | ||
|
||
- name: Extract version | ||
id: extract_version | ||
uses: Saionaro/[email protected] | ||
|
||
- name: Send success message to analytics-internal-bot slack channel | ||
id: slack | ||
uses: slackapi/[email protected] | ||
with: | ||
channel-id: ${{ secrets.SLACK_CHANNEL_ID }} | ||
payload: | | ||
{ | ||
"text": "Maps app release ${{ steps.extract_version.outputs.version }} succeeded", | ||
"blocks": [ | ||
{ | ||
"type": "header", | ||
"text": { | ||
"type": "plain_text", | ||
"text": ":large_green_circle: :maps-app: Maps version ${{ steps.extract_version.outputs.version }} released :tada:", | ||
"emoji": true | ||
} | ||
}, | ||
{ | ||
"type": "divider" | ||
}, | ||
{ | ||
"type": "section", | ||
"text": { | ||
"type": "mrkdwn", | ||
"text": "*Release Notes*" | ||
} | ||
}, | ||
{ | ||
"type": "section", | ||
"text": { | ||
"type": "mrkdwn", | ||
"text": ${{ toJSON(github.event.head_commit.message) }} | ||
} | ||
}, | ||
{ | ||
"type": "divider" | ||
}, | ||
{ | ||
"type": "section", | ||
"text": { | ||
"type": "mrkdwn", | ||
"text": "Link to <https://github.com/dhis2/maps-app/actions/workflows/dhis2-verify-app.yml?query=branch%3Amaster+is%3Asuccess|build>" | ||
} | ||
} | ||
] | ||
} | ||
env: | ||
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,6 +11,7 @@ env: | |
GIT_COMMITTER_NAME: '@dhis2-bot' | ||
GIT_COMMITTER_EMAIL: '[email protected]' | ||
GH_TOKEN: ${{secrets.DHIS2_BOT_GITHUB_TOKEN}} | ||
D2_APP_HUB_TOKEN: ${{secrets.DHIS2_BOT_APPHUB_TOKEN}} | ||
CI: true | ||
|
||
jobs: | ||
|
@@ -40,14 +41,6 @@ jobs: | |
- name: Build | ||
run: yarn d2-app-scripts build | ||
|
||
- uses: actions/upload-artifact@v3 | ||
with: | ||
name: app-build | ||
path: | | ||
**/build | ||
!**/node_modules | ||
retention-days: 1 | ||
|
||
lint: | ||
if: ${{ !contains(github.event.head_commit.message, '[skip release]') }} | ||
runs-on: ubuntu-latest | ||
|
@@ -119,25 +112,16 @@ jobs: | |
with: | ||
node-version: 18.x | ||
|
||
- uses: actions/download-artifact@v3 | ||
with: | ||
name: app-build | ||
|
||
- name: Install | ||
run: yarn install --frozen-lockfile | ||
|
||
- uses: dhis2/action-semantic-release@master | ||
with: | ||
publish-apphub: true | ||
publish-github: true | ||
github-token: ${{ secrets.DHIS2_BOT_GITHUB_TOKEN }} | ||
apphub-token: ${{ secrets.DHIS2_BOT_APPHUB_TOKEN }} | ||
- name: Run Semantic Release | ||
run: npx -p [email protected] semantic-release | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.DHIS2_BOT_GITHUB_TOKEN }} | ||
|
||
- name: Copy bundle to d2-ci | ||
uses: dhis2/deploy-build@master | ||
with: | ||
build-dir: build/app | ||
github-token: ${{ secrets.DHIS2_BOT_GITHUB_TOKEN }} | ||
- name: Publish to AppHub | ||
run: yarn run d2-app-scripts publish | ||
|
||
report-release-failure: | ||
runs-on: ubuntu-latest | ||
|
@@ -171,64 +155,3 @@ jobs: | |
} | ||
env: | ||
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} | ||
|
||
report-release-success: | ||
runs-on: ubuntu-latest | ||
needs: release | ||
if: ${{ success() && !cancelled() }} | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@master | ||
|
||
- name: Extract version | ||
id: extract_version | ||
uses: Saionaro/[email protected] | ||
|
||
- name: Send success message to analytics-internal-bot slack channel | ||
id: slack | ||
uses: slackapi/[email protected] | ||
with: | ||
channel-id: ${{ secrets.SLACK_CHANNEL_ID }} | ||
payload: | | ||
{ | ||
"text": "Maps app release ${{ steps.extract_version.outputs.version }} succeeded", | ||
"blocks": [ | ||
{ | ||
"type": "header", | ||
"text": { | ||
"type": "plain_text", | ||
"text": ":large_green_circle: :maps-app: Maps version ${{ steps.extract_version.outputs.version }} released :tada:", | ||
"emoji": true | ||
} | ||
}, | ||
{ | ||
"type": "divider" | ||
}, | ||
{ | ||
"type": "section", | ||
"text": { | ||
"type": "mrkdwn", | ||
"text": "*Release Notes*" | ||
} | ||
}, | ||
{ | ||
"type": "section", | ||
"text": { | ||
"type": "mrkdwn", | ||
"text": ${{ toJSON(github.event.head_commit.message) }} | ||
} | ||
}, | ||
{ | ||
"type": "divider" | ||
}, | ||
{ | ||
"type": "section", | ||
"text": { | ||
"type": "mrkdwn", | ||
"text": "Link to <https://github.com/dhis2/maps-app/actions/workflows/dhis2-verify-app.yml?query=branch%3Amaster+is%3Asuccess|build>" | ||
} | ||
} | ||
] | ||
} | ||
env: | ||
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
{ | ||
"branches": [ | ||
"master" | ||
], | ||
"plugins": [ | ||
"@semantic-release/commit-analyzer", | ||
"@semantic-release/release-notes-generator", | ||
"@semantic-release/changelog", | ||
"@semantic-release/npm", | ||
[ | ||
"@semantic-release/exec", | ||
{ | ||
"prepareCmd": "yarn build" | ||
} | ||
], | ||
[ | ||
"@semantic-release/git", | ||
{ | ||
"assets": [ | ||
"CHANGELOG.md", | ||
"package.json" | ||
], | ||
"message": "chore(release): cut ${nextRelease.version} [skip release]\n\n${nextRelease.notes}" | ||
} | ||
], | ||
[ | ||
"@semantic-release/github", | ||
{ | ||
"assets": [ | ||
{ | ||
"path": "build/bundle/*.zip", | ||
"label": "DHIS2 app bundle" | ||
} | ||
] | ||
} | ||
] | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.