feat: automatic draft release updated

This commit is contained in:
Jun Kurihara 2023-10-11 22:28:18 +09:00
commit 22f647cb2a
No known key found for this signature in database
GPG key ID: D992B3E3DE1DED23
3 changed files with 32 additions and 42 deletions

View file

@ -2,22 +2,20 @@ name: Unit Test
on: on:
push: push:
branches: [ main, develop ]
pull_request: pull_request:
branches: [ main, develop ] types: [synchronize, opened]
env: env:
CARGO_TERM_COLOR: always CARGO_TERM_COLOR: always
jobs: jobs:
test: test:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
with: with:
submodules: recursive submodules: recursive
- name: Run unit tests - name: Run unit tests
run: | run: |
cargo test --verbose cargo test --verbose

View file

@ -1,4 +1,4 @@
name: Build and Publish Docker name: Build and publish docker
on: on:
push: push:
branches: branches:
@ -6,8 +6,6 @@ on:
- "main" - "main"
tags: tags:
- "*.*.*" - "*.*.*"
pull_request:
types: [synchronize, opened]
env: env:
GHCR: ghcr.io GHCR: ghcr.io

View file

@ -1,20 +1,15 @@
name: Extract executable binary and upload artifacts name: Extract executable binary, upload artifacts, create release
on: on:
push: workflow_run:
# workflow_run: workflows:
# workflows: - "Build and publish docker"
# - "Build and Publish Docker" types:
# - "Unit Test" - "completed"
# types:
# - "completed"
# branches:
# - "main"
# - "develop"
jobs: jobs:
on-success: on-success:
runs-on: ubuntu-latest runs-on: ubuntu-latest
# if: ${{ github.event.workflow_run.conclusion == 'success' }} if: ${{ github.event.workflow_run.conclusion == 'success' }}
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
@ -75,13 +70,12 @@ jobs:
steps: steps:
- run: "echo 'The relese triggering workflows passed'" - run: "echo 'The relese triggering workflows passed'"
- name: "set env" - name: "set env"
#if [ ${{ github.ref_name == 'develop' }} ];then BUILD_NAME="rpxy-nightly";else BUILD_NAME="rpxy";fi
run: | run: |
if [ ${{ matrix.platform }} = "linux/amd64" ];then PLATFORM_MAP="x86_64";else PLATFORM_MAP="aarch64";fi 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 "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" - name: "docker pull and extract binary from docker image"
id: "extract-binary" id: "extract-binary"
@ -97,15 +91,15 @@ jobs:
name: ${{ steps.extract-binary.outputs.artifact }} name: ${{ steps.extract-binary.outputs.artifact }}
path: "/tmp/${{ steps.extract-binary.outputs.artifact }}" path: "/tmp/${{ steps.extract-binary.outputs.artifact }}"
# on-failure: on-failure:
# runs-on: ubuntu-latest runs-on: ubuntu-latest
# if: ${{ github.event.workflow_run.conclusion == 'failure' }} if: ${{ github.event.workflow_run.conclusion == 'failure' }}
# steps: steps:
# - run: echo 'The release triggering workflows failed' - run: echo 'The release triggering workflows failed'
release: release:
runs-on: ubuntu-latest runs-on: ubuntu-latest
# if: startsWith(github.ref, 'refs/tags/') if: startsWith(github.ref, 'refs/tags/')
needs: on-success needs: on-success
steps: steps:
- name: checkout - name: checkout
@ -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 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 ls -lha /tmp/assets
# - name: release - name: release
# uses: softprops/action-gh-release@v1 uses: softprops/action-gh-release@v1
# if: startsWith(github.ref, 'refs/tags/') if: startsWith(github.ref, 'refs/tags/')
# with: with:
# files: /tmp/assets/*.tar.gz files: /tmp/assets/*.tar.gz
# tag_name: ${{ github.ref }} tag_name: ${{ github.ref }}
# draft: true draft: true
# prerelease: false prerelease: false
# generate_release_notes: true generate_release_notes: true