From 1c38c7865b7126c5e63d349cf3de37f731e334f9 Mon Sep 17 00:00:00 2001 From: Mehul <65443164+infiniteregrets@users.noreply.github.com> Date: Mon, 4 Nov 2024 19:01:52 -0500 Subject: [PATCH 1/3] chore: add release CI action (#8) --- .github/workflows/release.yml | 79 +++++++++++++++++++++++++++++++++++ CHANGELOG.md | 3 ++ 2 files changed, 82 insertions(+) create mode 100644 .github/workflows/release.yml create mode 100644 CHANGELOG.md diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..eca9591 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,79 @@ +name: release +on: + push: + tags: ["[0-9]+.[0-9]+.[0-9]+*"] + workflow_dispatch: +jobs: + build_binaries: + name: ${{ matrix.target }} + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + include: + - os: ubuntu-latest + target: aarch64-unknown-linux-gnu + - os: ubuntu-latest + target: x86_64-unknown-linux-gnu + - os: macos-latest + target: x86_64-apple-darwin + - os: macos-latest + target: aarch64-apple-darwin + - os: windows-latest + target: x86_64-pc-windows-msvc + - os: windows-latest + target: aarch64-pc-windows-msvc + steps: + - name: checkout + uses: actions/checkout@v4 + - uses: actions-rust-lang/setup-rust-toolchain@v1 + with: + rustflags: "" + - uses: taiki-e/install-action@v2 + with: + tool: cross + - name: Build + run: cross build --release --target ${{ matrix.target }} + - name: Prepare artifacts + shell: bash + run: | + cd target/${{ matrix.target }}/release + + if [ "${{ matrix.os }}" = "windows-latest" ]; + then + 7z a ../../../$s2-cli-${{ matrix.target }}.zip s2-cli.exe + else + tar -czf ../../../$s2-cli-${{ matrix.target }}.tar.gz s2-cli + fi + - name: upload artifacts + uses: actions/upload-artifact@v4 + with: + name: ${{ matrix.target }} + path: | + *.tar.gz + *.zip + if-no-files-found: error + + create_release: + needs: build_binaries + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - name: checkout + uses: actions/checkout@v4 + - name: version + id: version + uses: SebRollen/toml-action@v1.2.0 + with: + file: Cargo.toml + field: package.version + - name: download artifacts + uses: actions/download-artifact@v4 + - name: create Release + uses: softprops/action-gh-release@v2 + with: + files: | + **/*.tar.gz + **/*.zip + name: ${{ steps.version.outputs.value }} diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..a2c6061 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,3 @@ +## 0.0.1 + +- All s2 operations. \ No newline at end of file From 64dfc4e4e0dc1dbb53401a0345648e3071c7137e Mon Sep 17 00:00:00 2001 From: Mehul <65443164+infiniteregrets@users.noreply.github.com> Date: Mon, 4 Nov 2024 20:19:11 -0500 Subject: [PATCH 2/3] fix: try to fix release CI (#9) --- .github/workflows/release.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index eca9591..b2f4483 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -32,6 +32,10 @@ jobs: - uses: taiki-e/install-action@v2 with: tool: cross + - run: | + git config --global --add url."https://${{ secrets.GH_TOKEN }}:x-oauth-basic@github.com/".insteadOf "git@github.com:" + git config --global --add url."https://${{ secrets.GH_TOKEN }}:x-oauth-basic@github".insteadOf https://github + git config --global --add url."https://${{ secrets.GH_TOKEN }}:x-oauth-basic@github".insteadOf ssh://git@github - name: Build run: cross build --release --target ${{ matrix.target }} - name: Prepare artifacts From d7fe5ed9552848640e4743a8a05aa4a0c6f647d6 Mon Sep 17 00:00:00 2001 From: Mehul <65443164+infiniteregrets@users.noreply.github.com> Date: Mon, 4 Nov 2024 20:31:08 -0500 Subject: [PATCH 3/3] fix: release CI (#10) --- .github/workflows/release.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b2f4483..e795cc2 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -32,6 +32,8 @@ jobs: - uses: taiki-e/install-action@v2 with: tool: cross + - name: install protoc + uses: arduino/setup-protoc@v3 - run: | git config --global --add url."https://${{ secrets.GH_TOKEN }}:x-oauth-basic@github.com/".insteadOf "git@github.com:" git config --global --add url."https://${{ secrets.GH_TOKEN }}:x-oauth-basic@github".insteadOf https://github