Release v0.12.0 #26
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Release | |
| on: | |
| push: | |
| tags: | |
| - "v*" | |
| workflow_dispatch: | |
| inputs: | |
| tag: | |
| description: "Tag to release" | |
| required: true | |
| permissions: | |
| contents: write | |
| jobs: | |
| release: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Resolve tag | |
| id: tag | |
| run: | | |
| if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then | |
| echo "name=${{ inputs.tag }}" >> "$GITHUB_OUTPUT" | |
| else | |
| echo "name=${GITHUB_REF#refs/tags/}" >> "$GITHUB_OUTPUT" | |
| fi | |
| - uses: actions/checkout@v4 | |
| with: | |
| ref: ${{ steps.tag.outputs.name }} | |
| - name: Test | |
| run: cargo test --release --locked | |
| - name: Build release binary | |
| run: cargo build --release --locked | |
| - name: Stage release tree | |
| run: | | |
| VERSION='${{ steps.tag.outputs.name }}' | |
| mkdir -p "sunsetr-${VERSION}" | |
| cp target/release/sunsetr "sunsetr-${VERSION}/" | |
| cp sunsetr.service "sunsetr-${VERSION}/" | |
| cp README.md LICENSE "sunsetr-${VERSION}/" | |
| tar -czf "sunsetr-${VERSION}-x86_64-linux.tar.gz" "sunsetr-${VERSION}" | |
| - name: Publish GitHub Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: ${{ steps.tag.outputs.name }} | |
| files: sunsetr-${{ steps.tag.outputs.name }}-x86_64-linux.tar.gz | |
| generate_release_notes: true | |
| fail_on_unmatched_files: true |