From e527019219494f439878c7bbcaa07638086af3d4 Mon Sep 17 00:00:00 2001 From: altsem Date: Tue, 12 Nov 2024 19:01:10 +0100 Subject: [PATCH] wip --- .github/workflows/release.yml | 114 ++++++++++++++++++---------------- 1 file changed, 59 insertions(+), 55 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 085b0f2557..fe7d349d6c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -14,51 +14,51 @@ jobs: - name: Checkout repository uses: actions/checkout@v4 - - name: Cargo publish - env: - CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} - run: | - cargo publish - - create-github-release: - runs-on: ubuntu-latest - environment: release - permissions: - contents: write - env: - GITU_VERSION: "" - outputs: - upload_url: ${{ steps.release.outputs.upload_url }} - gitu_version: ${{ env.GITU_VERSION }} - steps: - - name: Checkout repository - uses: actions/checkout@v4 - with: - sparse-checkout: .recent-changelog-entry - sparse-checkout-cone-mode: false - - - name: Gather information - shell: bash - if: env.GITU_VERSION == '' - run: | - echo "GITU_VERSION=${GITHUB_REF_NAME}" >> $GITHUB_ENV - echo "version is: ${{ env.GITU_VERSION }}" - - echo "CHANGELOG_ENTRY<> $GITHUB_ENV - cat .recent-changelog-entry >> $GITHUB_ENV - echo "EOF" >> $GITHUB_ENV - echo "changelog entry:" - echo "${{ env.CHANGELOG_ENTRY }}" - - - name: Create GitHub release - id: release - uses: actions/create-release@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - tag_name: ${{ env.GITU_VERSION }} - release_name: ${{ env.GITU_VERSION }} - body: "${{ env.CHANGELOG_ENTRY }}" + # - name: Cargo publish + # env: + # CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} + # run: | + # cargo publish + + # create-github-release: + # runs-on: ubuntu-latest + # environment: release + # permissions: + # contents: write + # env: + # GITU_VERSION: "" + # outputs: + # upload_url: ${{ steps.release.outputs.upload_url }} + # gitu_version: ${{ env.GITU_VERSION }} + # steps: + # - name: Checkout repository + # uses: actions/checkout@v4 + # with: + # sparse-checkout: .recent-changelog-entry + # sparse-checkout-cone-mode: false + + # - name: Gather information + # shell: bash + # if: env.GITU_VERSION == '' + # run: | + # echo "GITU_VERSION=${GITHUB_REF_NAME}" >> $GITHUB_ENV + # echo "version is: ${{ env.GITU_VERSION }}" + + # echo "CHANGELOG_ENTRY<> $GITHUB_ENV + # cat .recent-changelog-entry >> $GITHUB_ENV + # echo "EOF" >> $GITHUB_ENV + # echo "changelog entry:" + # echo "${{ env.CHANGELOG_ENTRY }}" + + # - name: Create GitHub release + # id: release + # uses: actions/create-release@v1 + # env: + # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # with: + # tag_name: ${{ env.GITU_VERSION }} + # release_name: ${{ env.GITU_VERSION }} + # body: "${{ env.CHANGELOG_ENTRY }}" build-github-release: needs: ['create-github-release'] @@ -99,7 +99,11 @@ jobs: fetch-tags: true - name: Build release binary - run: cargo build --verbose --release --locked ${{ env.TARGET_FLAGS }} + env: + GITU_VERSION: ${{ needs.create-github-release.outputs.gitu_version }} + run: | + git tag -am "$GITHUB_REF_NAME" "$GITHUB_REF_NAME" + cargo build --verbose --release --locked ${{ env.TARGET_FLAGS }} - name: Build archive (Windows) if: matrix.build == 'windows' @@ -131,12 +135,12 @@ jobs: tar czvf "$staging.tar.gz" "$staging" echo "ASSET=$staging.tar.gz" >> $GITHUB_ENV - - name: Upload release archive - uses: actions/upload-release-asset@v1.0.2 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: ${{ needs.create-github-release.outputs.upload_url }} - asset_path: ${{ env.ASSET }} - asset_name: ${{ env.ASSET }} - asset_content_type: application/octet-stream + # - name: Upload release archive + # uses: actions/upload-release-asset@v1.0.2 + # env: + # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # with: + # upload_url: ${{ needs.create-github-release.outputs.upload_url }} + # asset_path: ${{ env.ASSET }} + # asset_name: ${{ env.ASSET }} + # asset_content_type: application/octet-stream