From 66014ec3abb05f194d2bc6ed7ec930c9eecb9af9 Mon Sep 17 00:00:00 2001 From: Asmir Avdicevic Date: Wed, 2 Jul 2025 21:43:42 +0200 Subject: [PATCH] chore: release ci --- .github/workflows/release.yaml | 58 ++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 .github/workflows/release.yaml diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 0000000..c88ec36 --- /dev/null +++ b/.github/workflows/release.yaml @@ -0,0 +1,58 @@ +name: release +on: + push: + tags: + - "v*" + workflow_dispatch: + inputs: + release_version: + description: "Release version" + required: true + default: "" + create_release: + description: "Create release" + required: true + default: "true" + upload_artifacts: + description: "Upload artifacts" + required: true + default: "true" + +env: + BIN_NAME: iroh-c-ffi + IROH_FORCE_STAGING_RELAYS: "1" + +jobs: + create-release: + name: create-release + runs-on: ubuntu-latest + outputs: + upload_url: ${{ steps.release.outputs.upload_url }} + release_version: ${{ env.RELEASE_VERSION }} + steps: + - name: Get the release version from the tag (push) + shell: bash + if: env.RELEASE_VERSION == '' && github.event_name == 'push' + run: | + # See: https://github.community/t5/GitHub-Actions/How-to-get-just-the-tag-name/m-p/32167/highlight/true#M1027 + echo "RELEASE_VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV + echo "version is: ${{ env.RELEASE_VERSION }}" + - name: Get the release version from the tag (dispatch) + shell: bash + if: github.event_name == 'workflow_dispatch' + run: | + echo "RELEASE_VERSION=${{ github.event.inputs.release_version }}" >> $GITHUB_ENV + echo "version is: ${{ env.RELEASE_VERSION }}" + - name: Checkout repository + uses: actions/checkout@v4 + with: + fetch-depth: 1 + - name: Create GitHub release + id: release + if: github.event.inputs.create_release == 'true' || github.event_name == 'push' + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ env.RELEASE_VERSION }} + release_name: ${{ env.RELEASE_VERSION }} \ No newline at end of file