Skip to content

Commit

Permalink
chore: Reformats and fixes release yml.
Browse files Browse the repository at this point in the history
  • Loading branch information
imterah committed May 5, 2024
1 parent 08331c4 commit a498ecf
Showing 1 changed file with 80 additions and 65 deletions.
145 changes: 80 additions & 65 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,69 +1,84 @@
name: release

on:
pull_request:
types:
- closed
paths:
- 'VERSION'
workflow_dispatch:
push:
branches: dev
paths:
- VERSION
tags-ignore:
- '*'
pull_request:
types:
- closed
paths:
- VERSION
workflow_dispatch: null
push:
branches: dev
paths:
- VERSION
tags-ignore:
- '*'

jobs:
build:
if: github.event.pull_request.merged == true || github.event_name == 'workflow_dispatch' || github.event_name == 'push'
runs-on: ubuntu-latest
permissions:
packages: write
steps:
- name: Checkout code using Git
uses: actions/checkout@main
- name: Get version information
id: get_version
run: echo "version=v$(cat version)" >> $GITHUB_OUTPUT
- name: Make tag on Git
uses: laputansoft/[email protected]
with:
github_token: ${{secrets.GITHUB_TOKEN}}
tag: ${{ steps.get_version.outputs.version }}
- name: Make changelog
uses: heinrichreimer/[email protected]
with:
token: ${{secrets.GITHUB_TOKEN}}
issues: true
issuesWoLabels: true
pullRequests: true
prWoLabels: true
addSections: '{"documentation":{"prefix":" **Documentation:**","labels":["documentation"]}}'
- uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: 'chore: Update changelog for tag ${{steps.get_version.outputs.version}}'
file_pattern: CHANGELOG.md
- name: Release on GitHub
uses: softprops/action-gh-release@v2
with:
body_path: CHANGELOG.md
files: |
LICENSE
docker-compose.yml
repository: greysoh/nextnet
token: ${{ secrets.GITHUB_TOKEN }}
- 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
build:
if: >-
github.event.pull_request.merged == true || github.event_name == 'workflow_dispatch' || github.event_name == 'push'
runs-on: ubuntu-latest
permissions:
packages: write
contents: write

steps:
- name: Checkout code using Git
uses: actions/checkout@main

- name: Get version information
id: get_version
run: echo "version=v$(cat version)" >> $GITHUB_OUTPUT

- name: Make tag on Git
uses: laputansoft/[email protected]
with:
github_token: '${{secrets.GITHUB_TOKEN}}'
tag: '${{ steps.get_version.outputs.version }}'

- name: Make changelog
uses: heinrichreimer/[email protected]
with:
token: '${{secrets.GITHUB_TOKEN}}'
issues: true
issuesWoLabels: true
pullRequests: true
prWoLabels: true
addSections: >-
{"documentation":{"prefix":"
**Documentation:**","labels":["documentation"]}}
- uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: >-
chore: Update changelog for tag
${{steps.get_version.outputs.version}}
file_pattern: CHANGELOG.md

- name: Release on GitHub
uses: softprops/action-gh-release@v2
with:
body_path: CHANGELOG.md
files: |
LICENSE
docker-compose.yml
repository: greysoh/nextnet
token: '${{ secrets.GITHUB_TOKEN }}'

- 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

0 comments on commit a498ecf

Please sign in to comment.