Skip to content

Commit

Permalink
feat: automatic draft release updated
Browse files Browse the repository at this point in the history
  • Loading branch information
junkurihara committed Oct 11, 2023
1 parent b479245 commit 22f647c
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 42 deletions.
16 changes: 7 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,20 @@ name: Unit Test

on:
push:
branches: [ main, develop ]
pull_request:
branches: [ main, develop ]
types: [synchronize, opened]

env:
CARGO_TERM_COLOR: always

jobs:
test:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Run unit tests
run: |
cargo test --verbose
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Run unit tests
run: |
cargo test --verbose
4 changes: 1 addition & 3 deletions .github/workflows/docker_build_push.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
name: Build and Publish Docker
name: Build and publish docker
on:
push:
branches:
- "develop"
- "main"
tags:
- "*.*.*"
pull_request:
types: [synchronize, opened]

env:
GHCR: ghcr.io
Expand Down
54 changes: 24 additions & 30 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,15 @@
name: Extract executable binary and upload artifacts
name: Extract executable binary, upload artifacts, create release
on:
push:
# workflow_run:
# workflows:
# - "Build and Publish Docker"
# - "Unit Test"
# types:
# - "completed"
# branches:
# - "main"
# - "develop"
workflow_run:
workflows:
- "Build and publish docker"
types:
- "completed"

jobs:
on-success:
runs-on: ubuntu-latest
# if: ${{ github.event.workflow_run.conclusion == 'success' }}
if: ${{ github.event.workflow_run.conclusion == 'success' }}
strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -75,13 +70,12 @@ jobs:

steps:
- run: "echo 'The relese triggering workflows passed'"

- name: "set env"
#if [ ${{ github.ref_name == 'develop' }} ];then BUILD_NAME="rpxy-nightly";else BUILD_NAME="rpxy";fi
run: |
if [ ${{ matrix.platform }} = "linux/amd64" ];then PLATFORM_MAP="x86_64";else PLATFORM_MAP="aarch64";fi
if [ ${{ github.ref_name == 'develop' }} ];then BUILD_NAME="rpxy-nightly";else BUILD_NAME="rpxy";fi
echo "PLATFORM_MAP=${PLATFORM_MAP}" >> $GITHUB_ENV
echo "TARGET_NAME=rpxy-${PLATFORM_MAP}-unknown-linux-${{ matrix.target }}${{ matrix.build-feature }}" >> $GITHUB_ENV
echo "TARGET_NAME=${BUILD_NAME}-${PLATFORM_MAP}-unknown-linux-${{ matrix.target }}${{ matrix.build-feature }}" >> $GITHUB_ENV
- name: "docker pull and extract binary from docker image"
id: "extract-binary"
Expand All @@ -97,15 +91,15 @@ jobs:
name: ${{ steps.extract-binary.outputs.artifact }}
path: "/tmp/${{ steps.extract-binary.outputs.artifact }}"

# on-failure:
# runs-on: ubuntu-latest
# if: ${{ github.event.workflow_run.conclusion == 'failure' }}
# steps:
# - run: echo 'The release triggering workflows failed'
on-failure:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'failure' }}
steps:
- run: echo 'The release triggering workflows failed'

release:
runs-on: ubuntu-latest
# if: startsWith(github.ref, 'refs/tags/')
if: startsWith(github.ref, 'refs/tags/')
needs: on-success
steps:
- name: checkout
Expand All @@ -123,12 +117,12 @@ jobs:
for i in ./*; do sh -c "cd $i && tar zcvf $i.tar.gz $i && mv $i.tar.gz /tmp/assets/"; done
ls -lha /tmp/assets
# - name: release
# uses: softprops/action-gh-release@v1
# if: startsWith(github.ref, 'refs/tags/')
# with:
# files: /tmp/assets/*.tar.gz
# tag_name: ${{ github.ref }}
# draft: true
# prerelease: false
# generate_release_notes: true
- name: release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: /tmp/assets/*.tar.gz
tag_name: ${{ github.ref }}
draft: true
prerelease: false
generate_release_notes: true

0 comments on commit 22f647c

Please sign in to comment.