chore: Reformats and fixes release yml.

This commit is contained in:
greysoh 2024-05-05 18:13:17 -04:00
parent 08331c495d
commit a498ecf4a5
No known key found for this signature in database
GPG key ID: FE0F173B8FC01571

View file

@ -1,69 +1,84 @@
name: release name: release
on: on:
pull_request: pull_request:
types: types:
- closed - closed
paths: paths:
- 'VERSION' - VERSION
workflow_dispatch: workflow_dispatch: null
push: push:
branches: dev branches: dev
paths: paths:
- VERSION - VERSION
tags-ignore: tags-ignore:
- '*' - '*'
jobs: jobs:
build: build:
if: github.event.pull_request.merged == true || github.event_name == 'workflow_dispatch' || github.event_name == 'push' if: >-
runs-on: ubuntu-latest github.event.pull_request.merged == true || github.event_name == 'workflow_dispatch' || github.event_name == 'push'
permissions: runs-on: ubuntu-latest
packages: write permissions:
steps: packages: write
- name: Checkout code using Git contents: write
uses: actions/checkout@main
- name: Get version information steps:
id: get_version - name: Checkout code using Git
run: echo "version=v$(cat version)" >> $GITHUB_OUTPUT uses: actions/checkout@main
- name: Make tag on Git
uses: laputansoft/github-tag-action@v4.6 - name: Get version information
with: id: get_version
github_token: ${{secrets.GITHUB_TOKEN}} run: echo "version=v$(cat version)" >> $GITHUB_OUTPUT
tag: ${{ steps.get_version.outputs.version }}
- name: Make changelog - name: Make tag on Git
uses: heinrichreimer/github-changelog-generator-action@v2.1.1 uses: laputansoft/github-tag-action@v4.6
with: with:
token: ${{secrets.GITHUB_TOKEN}} github_token: '${{secrets.GITHUB_TOKEN}}'
issues: true tag: '${{ steps.get_version.outputs.version }}'
issuesWoLabels: true
pullRequests: true - name: Make changelog
prWoLabels: true uses: heinrichreimer/github-changelog-generator-action@v2.1.1
addSections: '{"documentation":{"prefix":" **Documentation:**","labels":["documentation"]}}' with:
- uses: stefanzweifel/git-auto-commit-action@v4 token: '${{secrets.GITHUB_TOKEN}}'
with: issues: true
commit_message: 'chore: Update changelog for tag ${{steps.get_version.outputs.version}}' issuesWoLabels: true
file_pattern: CHANGELOG.md pullRequests: true
- name: Release on GitHub prWoLabels: true
uses: softprops/action-gh-release@v2 addSections: >-
with: {"documentation":{"prefix":"
body_path: CHANGELOG.md **Documentation:**","labels":["documentation"]}}
files: |
LICENSE - uses: stefanzweifel/git-auto-commit-action@v4
docker-compose.yml with:
repository: greysoh/nextnet commit_message: >-
token: ${{ secrets.GITHUB_TOKEN }} chore: Update changelog for tag
- name: Log in to GitHub container registry ${{steps.get_version.outputs.version}}
uses: docker/login-action@v3 file_pattern: CHANGELOG.md
with:
registry: ghcr.io - name: Release on GitHub
username: ${{github.actor}} uses: softprops/action-gh-release@v2
password: ${{secrets.GITHUB_TOKEN}} with:
- name: Build all docker images body_path: CHANGELOG.md
run: | files: |
docker build ./api --tag ghcr.io/greysoh/api:$(cat VERSION) LICENSE
- name: Publish all docker images docker-compose.yml
run: | repository: greysoh/nextnet
docker tag ghcr.io/greysoh/api:$(cat VERSION) ghcr.io/greysoh/api:latest token: '${{ secrets.GITHUB_TOKEN }}'
docker push ghcr.io/greysoh/api:$(cat VERSION)
docker push ghcr.io/greysoh/api:latest - name: Log in to GitHub container registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: '${{github.actor}}'
password: '${{secrets.GITHUB_TOKEN}}'
- name: Build all docker images
run: |
docker build ./api --tag ghcr.io/greysoh/api:$(cat VERSION)
- name: Publish all docker images
run: >
docker tag ghcr.io/greysoh/api:$(cat VERSION) ghcr.io/greysoh/api:latest
docker push ghcr.io/greysoh/api:$(cat VERSION)
docker push ghcr.io/greysoh/api:latest