mirror of
https://github.com/ReVanced/revanced-bots.git
synced 2026-01-11 13:56:15 +00:00
ci(release): release and trigger portainer webhooks in different steps
This commit is contained in:
11
.github/workflows/release.yml
vendored
11
.github/workflows/release.yml
vendored
@@ -49,6 +49,17 @@ jobs:
|
||||
|
||||
- name: Build and release
|
||||
env:
|
||||
RELEASE_WORKFLOW_STEP: release
|
||||
GITHUB_ACTOR: ${{ github.actor }}
|
||||
GITHUB_TOKEN: ${{ secrets.REPOSITORY_PUSH_ACCESS }}
|
||||
run: bunx multi-semantic-release
|
||||
|
||||
# We call multi-semantic-release twice to publish in a different step
|
||||
# An environment variable determines which plugins in the config to run
|
||||
- name: Trigger Portainer webhooks
|
||||
if: github.ref == 'refs/heads/main'
|
||||
env:
|
||||
RELEASE_WORKFLOW_STEP: publish
|
||||
DOCKER_REGISTRY_USER: ${{ github.actor }}
|
||||
DOCKER_REGISTRY_PASSWORD: ${{ secrets.GITHUB_TOKEN }}
|
||||
GITHUB_ACTOR: ${{ github.actor }}
|
||||
|
||||
55
.releaserc
55
.releaserc
@@ -1,55 +0,0 @@
|
||||
{
|
||||
"branches": [
|
||||
"main",
|
||||
{
|
||||
"name": "dev",
|
||||
"prerelease": true
|
||||
}
|
||||
],
|
||||
"plugins": [
|
||||
[
|
||||
"@semantic-release/commit-analyzer",
|
||||
{
|
||||
"releaseRules": [
|
||||
{ "type": "build", "scope": "Needs bump", "release": "patch" }
|
||||
]
|
||||
}
|
||||
],
|
||||
"@semantic-release/release-notes-generator",
|
||||
"@semantic-release/changelog",
|
||||
[
|
||||
"@semantic-release/git",
|
||||
{
|
||||
"assets": [
|
||||
"README.md",
|
||||
"CHANGELOG.md",
|
||||
"package.json"
|
||||
]
|
||||
}
|
||||
],
|
||||
[
|
||||
"@semantic-release/github",
|
||||
{
|
||||
"assets": [
|
||||
{
|
||||
"path": "dist/*"
|
||||
}
|
||||
],
|
||||
"successComment": false
|
||||
}
|
||||
],
|
||||
[
|
||||
"@saithodev/semantic-release-backmerge",
|
||||
{
|
||||
"backmergeBranches": [
|
||||
{
|
||||
"from": "main",
|
||||
"to": "dev"
|
||||
}
|
||||
],
|
||||
"clearWorkspace": true
|
||||
},
|
||||
true
|
||||
]
|
||||
]
|
||||
}
|
||||
52
.releaserc.js
Normal file
52
.releaserc.js
Normal file
@@ -0,0 +1,52 @@
|
||||
export default {
|
||||
branches: [
|
||||
'main',
|
||||
{
|
||||
name: 'dev',
|
||||
prerelease: true,
|
||||
},
|
||||
],
|
||||
plugins:
|
||||
process.env.RELEASE_WORKFLOW_STEP === 'release'
|
||||
? [
|
||||
[
|
||||
'@semantic-release/commit-analyzer',
|
||||
{
|
||||
releaseRules: [{ type: 'build', scope: 'Needs bump', release: 'patch' }],
|
||||
},
|
||||
],
|
||||
'@semantic-release/release-notes-generator',
|
||||
'@semantic-release/changelog',
|
||||
[
|
||||
'@semantic-release/git',
|
||||
{
|
||||
assets: ['README.md', 'CHANGELOG.md', 'package.json'],
|
||||
},
|
||||
],
|
||||
[
|
||||
'@semantic-release/github',
|
||||
{
|
||||
assets: [
|
||||
{
|
||||
path: 'dist/*',
|
||||
},
|
||||
],
|
||||
successComment: false,
|
||||
},
|
||||
],
|
||||
[
|
||||
'@saithodev/semantic-release-backmerge',
|
||||
{
|
||||
backmergeBranches: [
|
||||
{
|
||||
from: 'main',
|
||||
to: 'dev',
|
||||
},
|
||||
],
|
||||
clearWorkspace: true,
|
||||
},
|
||||
true,
|
||||
],
|
||||
]
|
||||
: [],
|
||||
}
|
||||
@@ -1,25 +1,7 @@
|
||||
import { $ } from 'execa'
|
||||
|
||||
const branch = (await $`git rev-parse --abbrev-ref HEAD`).stdout.trim()
|
||||
|
||||
export default {
|
||||
plugins:
|
||||
branch === 'main'
|
||||
process.env.RELEASE_WORKFLOW_STEP === 'publish'
|
||||
? [
|
||||
[
|
||||
'@codedependant/semantic-release-docker',
|
||||
{
|
||||
dockerImage: 'revanced-bot-websocket-api',
|
||||
dockerRegistry: 'ghcr.io',
|
||||
dockerProject: 'revanced',
|
||||
dockerContext: '../..',
|
||||
dockerPlatform: ['linux/amd64', 'linux/arm64'],
|
||||
dockerArgs: {
|
||||
GITHUB_ACTOR: null,
|
||||
GITHUB_TOKEN: null,
|
||||
},
|
||||
},
|
||||
],
|
||||
[
|
||||
'@semantic-release/exec',
|
||||
{
|
||||
@@ -27,5 +9,18 @@ export default {
|
||||
},
|
||||
],
|
||||
]
|
||||
: [],
|
||||
: [
|
||||
'@codedependant/semantic-release-docker',
|
||||
{
|
||||
dockerImage: 'revanced-bot-websocket-api',
|
||||
dockerRegistry: 'ghcr.io',
|
||||
dockerProject: 'revanced',
|
||||
dockerContext: '../..',
|
||||
dockerPlatform: ['linux/amd64', 'linux/arm64'],
|
||||
dockerArgs: {
|
||||
GITHUB_ACTOR: null,
|
||||
GITHUB_TOKEN: null,
|
||||
},
|
||||
},
|
||||
],
|
||||
}
|
||||
|
||||
@@ -1,11 +1,15 @@
|
||||
import { $ } from 'execa'
|
||||
|
||||
const branch = (await $`git rev-parse --abbrev-ref HEAD`).stdout.trim()
|
||||
|
||||
export default {
|
||||
plugins:
|
||||
branch === 'main'
|
||||
process.env.RELEASE_WORKFLOW_STEP === 'publish'
|
||||
? [
|
||||
[
|
||||
'@semantic-release/exec',
|
||||
{
|
||||
publishCmd: 'bun run scripts/trigger-portainer-webhook.ts',
|
||||
},
|
||||
],
|
||||
]
|
||||
: [
|
||||
[
|
||||
'@codedependant/semantic-release-docker',
|
||||
{
|
||||
@@ -20,12 +24,5 @@ export default {
|
||||
},
|
||||
},
|
||||
],
|
||||
[
|
||||
'@semantic-release/exec',
|
||||
{
|
||||
publishCmd: 'bun run scripts/trigger-portainer-webhook.ts',
|
||||
},
|
||||
],
|
||||
]
|
||||
: [],
|
||||
],
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user