From 478204e3a9628a9fb0c1382c9f8afcbdb88ff2a0 Mon Sep 17 00:00:00 2001 From: Alex Ptakhin Date: Sat, 30 Mar 2024 21:53:52 +0100 Subject: [PATCH] Release pipeline added (#10) --- .github/workflows/publish.yml | 46 +++++++++++++++++++++++++++++++++++ Makefile | 3 +++ 2 files changed, 49 insertions(+) create mode 100644 .github/workflows/publish.yml diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..6e2a4a0 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,46 @@ +name: Publish + +on: + push: + tags: + - '*' + +env: + CARGO_TERM_COLOR: always + +jobs: + publish: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + - name: Build + run: cargo build --verbose + - name: Link to local cargo + run: ln -s `which cargo` + + - name: build + run: make build-release + - name: version + run: echo "::set-output name=version::$(./target/release/opday --version)" + id: version + - name: release + uses: actions/create-release@v1 + id: create_release + with: + draft: false + prerelease: false + release_name: ${{ steps.version.outputs.version }} + tag_name: ${{ github.ref }} + body: Changes in this release + env: + GITHUB_TOKEN: ${{ github.token }} + - name: upload linux artifact + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ github.token }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: ./target/release/opday + asset_name: opday-x86_64-unknown-linux + asset_content_type: application/gzip diff --git a/Makefile b/Makefile index 0740038..1e75dd9 100644 --- a/Makefile +++ b/Makefile @@ -19,6 +19,9 @@ doc:: docw:: ./cargo watch -x doc --no-deps +build-release:: + ./cargo build --release + l01:: RUST_LOG=debug RUST_BACKTRACE=1 ./cargo run -- docker login --config tests/01_trivial-backend-no-storage/opday.toml -f ./secrets/docker-config.json