Skip to content

Commit

Permalink
[ci] (fix): tagging and release on github
Browse files Browse the repository at this point in the history
  • Loading branch information
LoboMetalurgico committed Jan 2, 2024
1 parent afa3287 commit 095a032
Show file tree
Hide file tree
Showing 3 changed files with 84 additions and 100 deletions.
100 changes: 0 additions & 100 deletions .github/workflows/gitpublish.yml

This file was deleted.

51 changes: 51 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
on:
push:
tags:
- "v*.*.*"
- "v*.*.*-*.*"

jobs:
dist:
name: Create Dist and Release
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v3

- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: 20.x

- name: "Refresh tags"
id: tag
run: git fetch --tags --force

- id: set_var
name: "Get Version"
run: echo ::set-output name=version::$(node -p "require('./package.json').version")

- name: Update npm
run: npm install -g npm@latest

- name: Install Dependencies
run: npm ci

- name: Generate Dist Files
run: npm run dist

- name: Release
uses: softprops/action-gh-release@v1
with:
files: dist/arunacore.zip

publish-docker:
needs: [dist]
runs-on: ubuntu-latest
steps:
- name: Trigger Update Docker Image
uses: peter-evans/repository-dispatch@v2
with:
token: ${{ secrets.BOT_SECRET }}
event-type: publish-docker-image
repository: ArunaBot/ArunaCore-Docker
33 changes: 33 additions & 0 deletions .github/workflows/tag.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Publish Tag and Release

on:
workflow_run:
workflows: [Test]
types: [completed]
branches: [main]

jobs:
tag:
name: Publish Tag
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' }}
steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: "Refresh tags"
id: refresh-tag
run: git fetch --tags --force

- id: set_var
name: Get Version
run: echo ::set-output name=version::$(node -p "require('./package.json').version")

- name: Push Tag
id: tag
uses: anothrNick/github-tag-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
WITH_V: true
CUSTOM_TAG: "v${{ steps.set_var.outputs.version }}"

0 comments on commit 095a032

Please sign in to comment.