Skip to content

Commit

Permalink
Merge pull request #22 from sai80082/main
Browse files Browse the repository at this point in the history
 Automated releases and packages versioning
  • Loading branch information
varun-raj authored Aug 28, 2024
2 parents dcad608 + ddb31f5 commit b166cab
Show file tree
Hide file tree
Showing 4 changed files with 101 additions and 42 deletions.
41 changes: 0 additions & 41 deletions .github/workflows/docker-release.yml

This file was deleted.

45 changes: 45 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: ci

on:
push:
branches:
- main

jobs:
release:
runs-on: ubuntu-latest
outputs:
new-release-published: ${{ steps.release.outputs.new-release-published }}
new-release-version: ${{ steps.release.outputs.new-release-version }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 20
- name: Run semantic-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
id: release
run: |
npm install
npx semantic-release
build:
runs-on: ubuntu-latest
needs: release
if: needs.release.outputs.new-release-published == 'true'
steps:
- uses: actions/checkout@v3
- uses: docker/setup-buildx-action@v3
- uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push Docker image
run: |
docker build --build-arg VERSION=${{ needs.release.outputs.new-release-version }} \
-t ghcr.io/${{ github.repository }}:${{ needs.release.outputs.new-release-version }} \
-t ghcr.io/${{ github.repository }}:latest .
docker push ghcr.io/${{ github.repository }}:latest
docker push ghcr.io/${{ github.repository }}:${{ needs.release.outputs.new-release-version }}
49 changes: 49 additions & 0 deletions .releaserc
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
{
"branches": ["main"],
"plugins": [
[
"@semantic-release/commit-analyzer",
{
"preset": "angular",
"releaseRules": [
{ "type": "docs", "release": false },
{ "type": "refactor", "release": false},
{ "type": "feat", "release": "minor" },
{ "type": "fix", "release": "patch" },
{ "type": "perf", "release": "patch" },
{ "type": "chore", "release": false }
]
}
],
[
"@semantic-release/release-notes-generator",
{
"preset": "angular",
"writerOpts":{
"headerPartial":"## {{#if isPatch~}} <small>{{~/if~}} 🚀 **Immich Power Tools** {{version}}{{~#if isPatch~}} </small>{{~/if}}"
}
}
],
[
"@semantic-release/npm",
{
"npmPublish": false
}
],
[
"@semantic-release/github",
{
"assets": []
}
],
[
"@semantic-release/git",
{
"assets": ["package.json"],
"message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
}
],
["semantic-release-export-data"]

]
}
8 changes: 7 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "immich-power-tools",
"version": "0.1.5",
"version": "0.2.0",
"private": true,
"scripts": {
"dev": "next dev",
Expand Down Expand Up @@ -50,6 +50,11 @@
"yet-another-react-lightbox": "^3.21.4"
},
"devDependencies": {
"@semantic-release/commit-analyzer": "^13.0.0",
"@semantic-release/git": "^10.0.1",
"@semantic-release/github": "^10.1.7",
"@semantic-release/npm": "^12.0.1",
"@semantic-release/release-notes-generator": "^14.0.1",
"@types/node": "^20",
"@types/pg": "^8.11.6",
"@types/react": "^18",
Expand All @@ -59,6 +64,7 @@
"eslint": "^8",
"eslint-config-next": "14.2.5",
"postcss": "^8.4.41",
"semantic-release-export-data": "^1.1.0",
"tailwindcss": "^3.4.10",
"typescript": "^5"
}
Expand Down

0 comments on commit b166cab

Please sign in to comment.