Skip to content
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

semantic release #14

Merged
merged 1 commit into from
Jan 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 ]
}