Skip to content

Commit

Permalink
semantic release
Browse files Browse the repository at this point in the history
rename workflows and add deps

release workflow depends from test
  • Loading branch information
jaromil committed Jan 9, 2023
1 parent 798866a commit a001367
Show file tree
Hide file tree
Showing 4 changed files with 96 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
name: 🚀 Deploy did explorer
name: Deploy

on:
workflow_run:
workflows:
- Release
types: [completed]
branches:
- main
- release/**

push:
branches:
- main
Expand Down
60 changes: 60 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: Release

on:
workflow_run:
workflows:
- Tests
types: [completed]
branches:
- main
- release/**

concurrency:
group: ${{ github.workflow }}-${{ github.ref_name }}
cancel-in-progress: true

jobs:
semantic-release:
name: 🤖 Semantic release
runs-on: ubuntu-latest
if: "!contains(github.event.pull_request.labels.*.name, 'skip-release')"
# if: ${{ github.ref_name == 'main' && github.event_name == 'push' }}
outputs:
release: ${{ steps.tag_release.outputs.release }}
version: ${{ steps.tag_release.outputs.version }}
steps:
- uses: actions/checkout@v3
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 18.x
- name: Install semantic-release
run: |
npm i npx
npm i semantic-release/changelog
- name: Tag release
id: tag_release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
npx semantic-release | tee semantic-release.log
if [[ `git tag --points-at HEAD` == "" ]]; then
echo "release=False" >> $GITHUB_OUTPUT
else
echo "release=True" >> $GITHUB_OUTPUT
awk '/Published release/ { printf("version=v%s\n",$8) }' semantic-release.log >> $GITHUB_OUTPUT
fi
package-release:
name: 📦 release archives
needs: [semantic-release]
if: ${{ needs.semantic-release.outputs.release == 'True' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: softprops/action-gh-release@v1
with:
tag_name: ${{ needs.semantic-release.outputs.version }}
draft: true
prerelease: false
generate_release_notes: true
21 changes: 16 additions & 5 deletions .github/workflows/index.yml → .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,25 @@
name: W3C-DID
name: Tests

on:
push:
branches: [ main ]
paths-ignore:
- 'docs/**'
- '*.md'
branches:
- main
- release/**
pull_request:
branches: [ main ]
paths-ignore:
- 'docs/**'
- '*.md'
branches:
- main
- release/**

jobs:
test-units:
runs-on: ubuntu-latest
name: 🧪 test-units
name: 🧪 Contract unit tests
steps:
- name: 🛎️ Checkout
uses: actions/checkout@v3
Expand All @@ -25,7 +36,7 @@ jobs:
restroom_job:
runs-on: ubuntu-latest
name: 🔬 restroom tests
name: 🔬 API integration tests
steps:
- name: 🛎️ Checkout
uses: actions/checkout@v3
Expand Down
10 changes: 10 additions & 0 deletions .releaserc
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"repositoryUrl": "[email protected]:dyne/W3C-DID.git",
"dryRun": false,
"plugins": [
"@semantic-release/changelog",
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator"
],
"branches": [ main ]
}

0 comments on commit a001367

Please sign in to comment.