From e58a5831381cf61d9d6f72c9d681eafd70babba5 Mon Sep 17 00:00:00 2001 From: Filipe Veloso Date: Wed, 14 Feb 2024 00:10:53 -0300 Subject: [PATCH 01/11] add releases --- .github/workflows/ci.yml | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f79a5de..19ae651 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -56,3 +56,34 @@ jobs: with: name: ${{ matrix.target }} path: target/${{ matrix.target }}/release/ + release: + name: Release + runs-on: ubuntu-latest + needs: build + steps: + - uses: actions/download-artifact@v2 + with: + name: ${{ matrix.target }} + path: target/${{ matrix.target }}/release/ + - name: Create Release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: v1.0.0 + release_name: Release ${{ matrix.target }} + body: | + Changes in this Release + draft: false + prerelease: false + - name: Upload Release Asset + id: upload-release-asset + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: target/${{ matrix.target }}/release/ + asset_name: my-binary-${{ matrix.target }} + asset_content_type: application/octet-stream \ No newline at end of file From 5db28c7e44544abb83bc1e906503d1b97aec464d Mon Sep 17 00:00:00 2001 From: Filipe Veloso Date: Wed, 14 Feb 2024 00:16:34 -0300 Subject: [PATCH 02/11] change to main --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 19ae651..c7ef45f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -3,7 +3,7 @@ name: Rust Multi-Arch Build on: push: branches: - - master + - main pull_request: jobs: From 39168763e25967407b90937b254c0862c7cdfe3a Mon Sep 17 00:00:00 2001 From: Filipe Veloso Date: Wed, 14 Feb 2024 00:48:13 -0300 Subject: [PATCH 03/11] update release action --- .github/workflows/ci.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c7ef45f..b136168 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,5 +1,4 @@ name: Rust Multi-Arch Build - on: push: branches: @@ -79,11 +78,11 @@ jobs: prerelease: false - name: Upload Release Asset id: upload-release-asset - uses: actions/upload-release-asset@v1 + uses: actions/upload-release-asset@v1.0.1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: upload_url: ${{ steps.create_release.outputs.upload_url }} asset_path: target/${{ matrix.target }}/release/ - asset_name: my-binary-${{ matrix.target }} + asset_name: image_cleaner-${{ matrix.target }} asset_content_type: application/octet-stream \ No newline at end of file From 9368353978351bc3b9c751704f4134d0e8ab7123 Mon Sep 17 00:00:00 2001 From: Filipe Veloso Date: Wed, 14 Feb 2024 01:02:19 -0300 Subject: [PATCH 04/11] change release name and tags name --- .github/workflows/ci.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b136168..44f5cdf 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -64,14 +64,18 @@ jobs: with: name: ${{ matrix.target }} path: target/${{ matrix.target }}/release/ + - name: Set env + run: | + echo "BRANCH=${GITHUB_REF#refs/heads/}" >> $GITHUB_ENV + echo "TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV - name: Create Release id: create_release uses: actions/create-release@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: - tag_name: v1.0.0 - release_name: Release ${{ matrix.target }} + tag_name: ${{ env.TAG }} + release_name: ${{ env.BRANCH }}-${{ matrix.target }} body: | Changes in this Release draft: false From 61cabcb2028c0cbf293e28207072aecbed0465af Mon Sep 17 00:00:00 2001 From: Filipe Veloso Date: Wed, 14 Feb 2024 01:10:11 -0300 Subject: [PATCH 05/11] use fixed tag --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 44f5cdf..8ede5a8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -74,7 +74,7 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: - tag_name: ${{ env.TAG }} + tag_name: 0.1.0 release_name: ${{ env.BRANCH }}-${{ matrix.target }} body: | Changes in this Release From 1b5c73a9d71e78a301a2ce8ca63dddb88e22c0f9 Mon Sep 17 00:00:00 2001 From: Filipe Veloso Date: Wed, 14 Feb 2024 01:27:46 -0300 Subject: [PATCH 06/11] add release 0.1.0 --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8ede5a8..e6174c1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -51,7 +51,7 @@ jobs: - name: Build binary run: cross build --target ${{ matrix.target }} --release - name: Upload artifact - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: ${{ matrix.target }} path: target/${{ matrix.target }}/release/ @@ -75,7 +75,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: tag_name: 0.1.0 - release_name: ${{ env.BRANCH }}-${{ matrix.target }} + release_name: image_cleaner-0.1.0-${{ matrix.target }} body: | Changes in this Release draft: false From 996aede71a18883828cf4c8ae40cd63d2cd9f4aa Mon Sep 17 00:00:00 2001 From: Filipe Veloso Date: Fri, 16 Feb 2024 23:19:40 -0300 Subject: [PATCH 07/11] add new release job only on master --- .github/workflows/ci.yml | 12 +----------- .github/workflows/release.yml | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+), 11 deletions(-) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e6174c1..3a3e6e4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -79,14 +79,4 @@ jobs: body: | Changes in this Release draft: false - prerelease: false - - name: Upload Release Asset - id: upload-release-asset - uses: actions/upload-release-asset@v1.0.1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: target/${{ matrix.target }}/release/ - asset_name: image_cleaner-${{ matrix.target }} - asset_content_type: application/octet-stream \ No newline at end of file + prerelease: false \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..a2384f9 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,21 @@ +name: Bump version +on: + push: + branches: + - master +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Bump version and push tag + id: tag_version + uses: mathieudutour/github-tag-action@v6.1 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + - name: Create a GitHub release + uses: ncipollo/release-action@v1 + with: + tag: ${{ steps.tag_version.outputs.new_tag }} + name: Release ${{ steps.tag_version.outputs.new_tag }} + body: ${{ steps.tag_version.outputs.changelog }} \ No newline at end of file From 33576b6649ab4a3b9677ce8a8bbe4dc16f975bab Mon Sep 17 00:00:00 2001 From: Filipe Veloso Date: Fri, 16 Feb 2024 23:19:56 -0300 Subject: [PATCH 08/11] change name --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a2384f9..1b5643c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,4 +1,4 @@ -name: Bump version +name: Tag and Release on: push: branches: From 1b49ae537ddf9692277215d41ef1552d7d6b770d Mon Sep 17 00:00:00 2001 From: Filipe Veloso Date: Fri, 16 Feb 2024 23:44:44 -0300 Subject: [PATCH 09/11] remove release from ci --- .github/workflows/ci.yml | 31 +------------------------------ 1 file changed, 1 insertion(+), 30 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3a3e6e4..3ebd936 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -41,11 +41,7 @@ jobs: steps: - uses: actions/checkout@v4 - name: Set up Rust - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - target: ${{ matrix.target }} - override: true + run: curl https://sh.rustup.rs -sSf | sh -s -- -y ${{ matrix.target }} - name: Install cross run: cargo install cross - name: Build binary @@ -55,28 +51,3 @@ jobs: with: name: ${{ matrix.target }} path: target/${{ matrix.target }}/release/ - release: - name: Release - runs-on: ubuntu-latest - needs: build - steps: - - uses: actions/download-artifact@v2 - with: - name: ${{ matrix.target }} - path: target/${{ matrix.target }}/release/ - - name: Set env - run: | - echo "BRANCH=${GITHUB_REF#refs/heads/}" >> $GITHUB_ENV - echo "TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV - - name: Create Release - id: create_release - uses: actions/create-release@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - tag_name: 0.1.0 - release_name: image_cleaner-0.1.0-${{ matrix.target }} - body: | - Changes in this Release - draft: false - prerelease: false \ No newline at end of file From 9a86bbf75dd6a57e96c4b1126baa6a4b7c5af855 Mon Sep 17 00:00:00 2001 From: Filipe Veloso Date: Fri, 16 Feb 2024 23:45:58 -0300 Subject: [PATCH 10/11] update rust install --- .github/workflows/ci.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3ebd936..28ff9ad 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,11 +18,7 @@ jobs: steps: - uses: actions/checkout@v4 - name: Set up Rust - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - target: ${{ matrix.target }} - override: true + run: curl https://sh.rustup.rs -sSf | sh -s -- -y ${{ matrix.target }} - name: Install cross run: cargo install cross - name: Test binary From 19b4d1dd19611f8999dff123b2510e5034e91b4c Mon Sep 17 00:00:00 2001 From: Filipe Veloso Date: Fri, 16 Feb 2024 23:46:56 -0300 Subject: [PATCH 11/11] fix command --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 28ff9ad..77b1138 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,7 +18,7 @@ jobs: steps: - uses: actions/checkout@v4 - name: Set up Rust - run: curl https://sh.rustup.rs -sSf | sh -s -- -y ${{ matrix.target }} + run: curl https://sh.rustup.rs -sSf | sh -s -- -y - name: Install cross run: cargo install cross - name: Test binary @@ -37,7 +37,7 @@ jobs: steps: - uses: actions/checkout@v4 - name: Set up Rust - run: curl https://sh.rustup.rs -sSf | sh -s -- -y ${{ matrix.target }} + run: curl https://sh.rustup.rs -sSf | sh -s -- -y - name: Install cross run: cargo install cross - name: Build binary