aboutsummaryrefslogtreecommitdiff
path: root/.github/workflows/build.yml
diff options
context:
space:
mode:
authorKunoiSayami <[email protected]>2021-05-08 01:22:08 +0800
committerKunoiSayami <[email protected]>2021-05-08 01:22:08 +0800
commit86e4c76dabb20b7f489abcb1f1c3cdb11a494b91 (patch)
tree8369ddbd694637a61fc337c71e89d61e62bc8286 /.github/workflows/build.yml
parent3a8881fbaab4d18b865a44198db9c195041cbff2 (diff)
fix: Fix authenticate-cookie not working properlyv0.1.2
* feat: Add adduser subcommand
Diffstat (limited to '.github/workflows/build.yml')
-rw-r--r--.github/workflows/build.yml59
1 files changed, 59 insertions, 0 deletions
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
new file mode 100644
index 0000000..9e7f700
--- /dev/null
+++ b/.github/workflows/build.yml
@@ -0,0 +1,59 @@
+name: Build binary
+
+on:
+ push:
+ tags:
+ - v**
+ pull_request:
+
+jobs:
+ build:
+ strategy:
+ fail-fast: true
+ matrix:
+ job:
+ - { os: macos-latest }
+ - { os: ubuntu-latest }
+ - { os: windows-latest }
+
+
+ name: Build
+ runs-on: ${{ matrix.job.os }}
+ steps:
+ - uses: actions/checkout@v2
+ - uses: actions-rs/toolchain@v1
+ with:
+ profile: minimal
+ toolchain: stable
+ override: true
+ - uses: actions-rs/cargo@v1
+ with:
+ command: build
+ args: --release
+ - name: Rename binary
+ id: rename
+ shell: bash
+ run: |
+ if [ "$RUNNER_OS" == "Linux" ]; then
+ BIN='cgit-simple-authentication_linux_amd64'
+ mv target/release/cgit-simple-authentication target/release/$BIN
+ elif [ "$RUNNER_OS" == "macOS" ]; then
+ BIN='cgit-simple-authentication_darwin_amd64'
+ mv target/release/cgit-simple-authentication target/release/$BIN
+ else
+ BIN='cgit-simple-authentication_windows_amd64.exe'
+ mv target/release/cgit-simple-authentication.exe target/release/$BIN
+ fi
+ echo "::set-output name=bin::target/release/$BIN"
+ - uses: actions/upload-artifact@v2
+ with:
+ name: artifact
+ path: |
+ target/release/cgit-simple-authentication_*
+ - name: Release
+ uses: softprops/action-gh-release@v1
+ if: startsWith(github.ref, 'refs/tags/')
+ with:
+ files: ${{ steps.rename.outputs.bin }}
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file