Skip to content

Commit

Permalink
ci: abstract release
Browse files Browse the repository at this point in the history
  • Loading branch information
ismay committed Jun 11, 2024
1 parent c8811aa commit 45569bd
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 42 deletions.
44 changes: 2 additions & 42 deletions .github/workflows/dhis2-verify-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,58 +5,18 @@ concurrency:
# Cancel previous runs if not on a release branch
cancel-in-progress: ${{ !contains(github.ref, fromJSON('["master", "main"]')) }}

env:
GIT_AUTHOR_NAME: '@dhis2-bot'
GIT_AUTHOR_EMAIL: 'apps@dhis2.org'
GIT_COMMITTER_NAME: '@dhis2-bot'
GIT_COMMITTER_EMAIL: 'apps@dhis2.org'
D2_VERBOSE: true

jobs:
build:
uses: ./.github/workflows/build.yml

lint:
uses: ./.github/workflows/lint.yml

test:
uses: ./.github/workflows/test.yml

e2e:
uses: ./.github/workflows/e2e.yml
secrets: inherit

release:
runs-on: ubuntu-latest
needs: [build, lint, test, e2e]
uses: ./.github/workflows/release.yml
if: "!github.event.push.repository.fork && github.actor != 'dependabot[bot]'"
steps:
- uses: actions/checkout@v2
with:
token: ${{ secrets.DHIS2_BOT_GITHUB_TOKEN }}

- uses: actions/setup-node@v3
with:
node-version: 20
cache: 'yarn'

- uses: actions/download-artifact@v2
with:
name: app-build

# ensure that d2-app-scripts is available
- 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 }}

- uses: dhis2/deploy-build@master
with:
# uncomment following line for monorepo apps:
#cwd: ./packages/app
build-dir: build/app
github-token: ${{ secrets.DHIS2_BOT_GITHUB_TOKEN }}
secrets: inherit
35 changes: 35 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
on:
workflow_call:
secrets:
DHIS2_BOT_GITHUB_TOKEN:
required: true
DHIS2_BOT_APPHUB_TOKEN:
required: true

env:
GIT_AUTHOR_NAME: '@dhis2-bot'
GIT_AUTHOR_EMAIL: 'apps@dhis2.org'
GIT_COMMITTER_NAME: '@dhis2-bot'
GIT_COMMITTER_EMAIL: 'apps@dhis2.org'

jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: 'yarn'
- run: yarn install --frozen-lockfile
- run: yarn d2-app-scripts build
- 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 }}
- uses: dhis2/deploy-build@master
with:
build-dir: build/app
github-token: ${{ secrets.DHIS2_BOT_GITHUB_TOKEN }}

0 comments on commit 45569bd

Please sign in to comment.