diff --git a/.github/workflows/publish.yml.bak b/.github/workflows/publish.yml.bak deleted file mode 100644 index 4fd31a7..0000000 --- a/.github/workflows/publish.yml.bak +++ /dev/null @@ -1,50 +0,0 @@ -name: Publish to Cargo - -on: - push: - branches: [ master ] - -jobs: - publish: - runs-on: ubuntu-latest - - name: 'publish' - - # Reference your environment variables - environment: Cargo - - steps: - - uses: actions/checkout@master - - # Use caching to speed up your build - - name: Cache publish-action bin - id: cache-publish-action - uses: actions/cache@v3 - env: - cache-name: cache-publish-action - with: - path: ~/.cargo - key: ${{ runner.os }}-build-${{ env.cache-name }}-v0.2.0 - - # install publish-action by cargo in github action - - name: Install publish-action - if: steps.cache-publish-action.outputs.cache-hit != 'true' - run: - cargo install publish-action --version=0.2.0 - - name: initial res - run: - git submodule update --init - - name: Run publish-action - id: publish-action - run: - publish-action - env: - # This can help you tagging the github repository - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - # This can help you publish to crates.io - CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} - - #- name: Update Changelog.md - # if: steps.publish-action.outputs.new_version == 'true' && steps.publish-action.outputs.publish == 'true' - # run: | - # changelog -o Changelog.md \ No newline at end of file diff --git a/.github/workflows/release-plz.yml b/.github/workflows/release-pr.yml similarity index 81% rename from .github/workflows/release-plz.yml rename to .github/workflows/release-pr.yml index af5c35e..39fc1ea 100644 --- a/.github/workflows/release-plz.yml +++ b/.github/workflows/release-pr.yml @@ -1,4 +1,4 @@ -name: Release-plz +name: Release-pr permissions: pull-requests: write @@ -6,12 +6,12 @@ permissions: on: workflow_dispatch: - # repository_dispatch: - # types: [publish] + repository_dispatch: + types: [publish] jobs: - release-plz: - name: Release-plz + release-pr: + name: Release-pr runs-on: ubuntu-latest environment: Cargo steps: @@ -29,3 +29,5 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} + with: + command: release-pr diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..dcdb154 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,33 @@ +name: Release-Publish + +permissions: + pull-requests: write + contents: write + +on: + push: + branches: + - master + +jobs: + release-publish: + name: Release-Publish + runs-on: ubuntu-latest + environment: Cargo + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: initial submodule + run: + git submodule update --init + - name: Install Rust toolchain + uses: dtolnay/rust-toolchain@stable + - name: Run release-plz + uses: MarcoIeni/release-plz-action@v0.5 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} + with: + command: release diff --git a/.github/workflows/release.yml.bak b/.github/workflows/release.yml.bak deleted file mode 100644 index bd69b92..0000000 --- a/.github/workflows/release.yml.bak +++ /dev/null @@ -1,22 +0,0 @@ -name: Release - -permissions: - contents: write - -on: - push: - tags: - - '*' - -jobs: - create-release: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: taiki-e/create-gh-release-action@v1 - with: - # (Optional) Path to changelog. - # changelog: CHANGELOG.md - title: v$tag - # (Required) GitHub token for creating GitHub Releases. - token: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file