From a273d95e494905914a8cc36a6d2b1291306756e1 Mon Sep 17 00:00:00 2001 From: Takaya Saeki Date: Wed, 6 Jul 2022 02:22:33 +0900 Subject: [PATCH] ci: fix version command which was not solved by #58 (#61) The fix introduced by #58 was not sufficient. This PR indeed makes cargo build for the latest updated version. --- .github/workflows/cd.yaml | 33 ++++++++++++++++++++++++++++----- 1 file changed, 28 insertions(+), 5 deletions(-) diff --git a/.github/workflows/cd.yaml b/.github/workflows/cd.yaml index 59bf7ad..ac69982 100644 --- a/.github/workflows/cd.yaml +++ b/.github/workflows/cd.yaml @@ -11,6 +11,14 @@ on: description: "Whether to skip automatic version bump (yes/no)" required: false default: "no" + skips_version_commit: + description: "Whether to skip the version commit (yes/no)" + required: false + default: "no" + skips_publish: + description: "Whether to skip publishing the release assets (yes/no)" + required: false + default: "no" env: CARGO_TERM_COLOR: always @@ -19,10 +27,12 @@ jobs: publish-release_assets: name: Publish the release assets runs-on: ubuntu-latest - needs: [build-distrod_wsl_launcher] + needs: [build-distrod_wsl_launcher, bump-version] steps: - uses: actions/checkout@v2 + with: + ref: ${{ needs.bump-version.outputs.tag }} - name: Get the arch name run: | @@ -49,20 +59,21 @@ jobs: - name: Upload Binaries to Release uses: svenstaro/upload-release-action@v2 + if: github.event.inputs.skips_publish != 'yes' with: repo_token: ${{ secrets.GITHUB_TOKEN }} file: assets/* file_glob: true - tag: ${{ steps.changelog.outputs.tag }} + tag: ${{ needs.bump-version.outputs.tag }} overwrite: true prerelease: ${{ github.event.inputs.is_prerelease == 'yes' }} - release_name: ${{ steps.changelog.outputs.tag }} - body: ${{ steps.changelog.outputs.clean_changelog }} + release_name: ${{ needs.bump-version.outputs.tag }} + body: ${{ needs.bump-version.outputs.clean_changelog }} build-distrod_wsl_launcher: name: Build Distrod WSL launcher runs-on: windows-latest - needs: [build-distrod-command] + needs: [build-distrod-command, bump-version] defaults: run: @@ -70,6 +81,9 @@ jobs: steps: - uses: actions/checkout@v2 + with: + ref: ${{ needs.bump-version.outputs.tag }} + - uses: actions/cache@v2 with: path: | @@ -107,6 +121,9 @@ jobs: steps: - uses: actions/checkout@v2 + with: + ref: ${{ needs.bump-version.outputs.tag }} + - uses: actions/cache@v2 with: path: | @@ -157,8 +174,12 @@ jobs: bump-version: name: Bump the version runs-on: ubuntu-latest + outputs: + tag: ${{ steps.changelog.outputs.tag }} + clean_changelog: ${{ steps.changelog.outputs.clean_changelog }} steps: + - uses: actions/checkout@v2 - name: Conventional Changelog Action id: changelog uses: TriPSs/conventional-changelog-action@v3 @@ -171,6 +192,8 @@ jobs: git-user-email: "41898282+github-actions[bot]@users.noreply.github.com" release-count: "0" skip-version-file: ${{ github.event.inputs.skips_version_bump == 'yes' }} + skip-commit: ${{ github.event.inputs.skips_version_commit == 'yes' }} + skip-ci: false build-portproxy-exe: name: Build portproxy.exe