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