mirror of
https://github.com/sourcegit-scm/sourcegit.git
synced 2025-01-11 23:57:21 -08:00
Compare commits
6 commits
52a9d779d2
...
3a909e00a3
Author | SHA1 | Date | |
---|---|---|---|
|
3a909e00a3 | ||
|
75e9f1e9a4 | ||
|
1ddd348a40 | ||
|
d616d0897b | ||
|
43928936bc | ||
|
abacccab00 |
8 changed files with 103 additions and 18 deletions
39
.github/workflows/publish-packages.yml
vendored
Normal file
39
.github/workflows/publish-packages.yml
vendored
Normal file
|
@ -0,0 +1,39 @@
|
|||
name: Publish to Buildkite
|
||||
on:
|
||||
workflow_call:
|
||||
secrets:
|
||||
BUILDKITE_TOKEN:
|
||||
required: true
|
||||
jobs:
|
||||
publish:
|
||||
name: Publish to Buildkite
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
runtime: [linux-x64, linux-arm64]
|
||||
steps:
|
||||
- name: Download package artifacts
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: package.${{ matrix.runtime }}
|
||||
path: packages
|
||||
|
||||
- name: Publish DEB package
|
||||
env:
|
||||
BUILDKITE_TOKEN: ${{ secrets.BUILDKITE_TOKEN }}
|
||||
run: |
|
||||
FILE=$(echo packages/*.deb)
|
||||
curl -X POST https://api.buildkite.com/v2/packages/organizations/sourcegit/registries/sourcegit-deb/packages \
|
||||
-H "Authorization: Bearer $BUILDKITE_TOKEN" \
|
||||
-F "file=@$FILE" \
|
||||
--fail
|
||||
|
||||
- name: Publish RPM package
|
||||
env:
|
||||
BUILDKITE_TOKEN: ${{ secrets.BUILDKITE_TOKEN }}
|
||||
run: |
|
||||
FILE=$(echo packages/*.rpm)
|
||||
curl -X POST https://api.buildkite.com/v2/packages/organizations/sourcegit/registries/sourcegit-rpm/packages \
|
||||
-H "Authorization: Bearer $BUILDKITE_TOKEN" \
|
||||
-F "file=@$FILE" \
|
||||
--fail
|
5
.github/workflows/release.yml
vendored
5
.github/workflows/release.yml
vendored
|
@ -24,6 +24,11 @@ jobs:
|
|||
uses: ./.github/workflows/package.yml
|
||||
with:
|
||||
version: ${{ needs.version.outputs.version }}
|
||||
publish-packages:
|
||||
name: Publish Packages
|
||||
uses: ./.github/workflows/publish-packages.yml
|
||||
secrets:
|
||||
BUILDKITE_TOKEN: ${{ secrets.BUILDKITE_TOKEN }}
|
||||
release:
|
||||
needs: [package, version]
|
||||
name: Release
|
||||
|
|
|
@ -18,6 +18,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "workflows", "workflows", "{
|
|||
.github\workflows\package.yml = .github\workflows\package.yml
|
||||
.github\workflows\release.yml = .github\workflows\release.yml
|
||||
.github\workflows\localization-check.yml = .github\workflows\localization-check.yml
|
||||
.github\workflows\publish-packages.yml = .github\workflows\publish-packages.yml
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{49A7C2D6-558C-4FAA-8F5D-EEE81497AED7}"
|
||||
|
|
|
@ -7,6 +7,7 @@ URL: https://sourcegit-scm.github.io/
|
|||
Source: https://github.com/sourcegit-scm/sourcegit/archive/refs/tags/v%_version.tar.gz
|
||||
Requires: libX11.so.6()(%{__isa_bits}bit)
|
||||
Requires: libSM.so.6()(%{__isa_bits}bit)
|
||||
Requires: libicu
|
||||
|
||||
%define _build_id_links none
|
||||
|
||||
|
|
|
@ -7,6 +7,8 @@ namespace SourceGit.Models
|
|||
public List<string> Ahead { get; set; } = new List<string>();
|
||||
public List<string> Behind { get; set; } = new List<string>();
|
||||
|
||||
public bool IsVisible => Ahead.Count > 0 || Behind.Count > 0;
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
if (Ahead.Count == 0 && Behind.Count == 0)
|
||||
|
|
|
@ -16,6 +16,18 @@
|
|||
<StackPanel Grid.Row="0" Grid.Column="1" Orientation="Horizontal">
|
||||
<Path Width="14" Height="14" Margin="8,0" Data="{StaticResource Icons.Branch}"/>
|
||||
<TextBlock Text="{Binding Target.FriendlyName}"/>
|
||||
<Border Height="18"
|
||||
Margin="8,0,0,0"
|
||||
Padding="8,0"
|
||||
VerticalAlignment="Center"
|
||||
CornerRadius="9"
|
||||
Background="{DynamicResource Brush.Badge}"
|
||||
IsVisible="{Binding Target.TrackStatus.IsVisible}">
|
||||
<TextBlock Foreground="{DynamicResource Brush.BadgeFG}"
|
||||
FontFamily="{DynamicResource Fonts.Monospace}"
|
||||
FontSize="10"
|
||||
Text="{Binding Target.TrackStatus}"/>
|
||||
</Border>
|
||||
</StackPanel>
|
||||
|
||||
<Border Grid.Row="1" Grid.Column="1" Height="32" IsVisible="{Binding !Target.IsLocal}">
|
||||
|
|
|
@ -42,9 +42,22 @@
|
|||
|
||||
<ListBox.ItemTemplate>
|
||||
<DataTemplate DataType="m:Branch">
|
||||
<Grid Height="26" ColumnDefinitions="22,*">
|
||||
<Grid Height="26" ColumnDefinitions="22,*,Auto">
|
||||
<Path Grid.Column="0" Width="10" Height="10" Margin="4,0,8,0" Data="{StaticResource Icons.Branch}" />
|
||||
<TextBlock Grid.Column="1" Text="{Binding FriendlyName}" Classes="primary" />
|
||||
<Border Grid.Column="2"
|
||||
Height="18"
|
||||
Margin="8,0"
|
||||
Padding="8,0"
|
||||
VerticalAlignment="Center"
|
||||
CornerRadius="9"
|
||||
Background="{DynamicResource Brush.Badge}"
|
||||
IsVisible="{Binding TrackStatus.IsVisible}">
|
||||
<TextBlock Foreground="{DynamicResource Brush.BadgeFG}"
|
||||
FontFamily="{DynamicResource Fonts.Monospace}"
|
||||
FontSize="10"
|
||||
Text="{Binding TrackStatus}"/>
|
||||
</Border>
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
</ListBox.ItemTemplate>
|
||||
|
|
|
@ -430,31 +430,43 @@ namespace SourceGit.Views
|
|||
if (ShowAsDateTime)
|
||||
return DateTime.UnixEpoch.AddSeconds(timestamp).ToLocalTime().ToString("yyyy/MM/dd HH:mm:ss");
|
||||
|
||||
var today = DateTime.Today;
|
||||
var localTime = DateTime.UnixEpoch.AddSeconds(timestamp).ToLocalTime();
|
||||
|
||||
if (localTime >= today)
|
||||
{
|
||||
var now = DateTime.Now;
|
||||
var timespan = now - localTime;
|
||||
if (timespan.TotalHours > 1)
|
||||
return App.Text("Period.HoursAgo", (int)timespan.TotalHours);
|
||||
var localTime = DateTime.UnixEpoch.AddSeconds(timestamp).ToLocalTime();
|
||||
var span = now - localTime;
|
||||
if (span.TotalMinutes < 1)
|
||||
return App.Text("Period.JustNow");
|
||||
|
||||
return timespan.TotalMinutes < 1 ? App.Text("Period.JustNow") : App.Text("Period.MinutesAgo", (int)timespan.TotalMinutes);
|
||||
}
|
||||
if (span.TotalHours < 1)
|
||||
return App.Text("Period.MinutesAgo", (int)span.TotalMinutes);
|
||||
|
||||
var diffYear = today.Year - localTime.Year;
|
||||
if (diffYear == 0)
|
||||
if (span.TotalDays < 1)
|
||||
return App.Text("Period.HoursAgo", (int)span.TotalHours);
|
||||
|
||||
var lastDay = now.AddDays(-1).Date;
|
||||
if (localTime >= lastDay)
|
||||
return App.Text("Period.Yesterday");
|
||||
|
||||
if ((localTime.Year == now.Year && localTime.Month == now.Month) || span.TotalDays < 28)
|
||||
{
|
||||
var diffMonth = today.Month - localTime.Month;
|
||||
if (diffMonth > 0)
|
||||
return diffMonth == 1 ? App.Text("Period.LastMonth") : App.Text("Period.MonthsAgo", diffMonth);
|
||||
|
||||
var diffDay = today.Day - localTime.Day;
|
||||
return diffDay == 1 ? App.Text("Period.Yesterday") : App.Text("Period.DaysAgo", diffDay);
|
||||
var diffDay = now.Date - localTime.Date;
|
||||
return App.Text("Period.DaysAgo", (int)diffDay.TotalDays);
|
||||
}
|
||||
|
||||
return diffYear == 1 ? App.Text("Period.LastYear") : App.Text("Period.YearsAgo", diffYear);
|
||||
var lastMonth = now.AddMonths(-1).Date;
|
||||
if (localTime.Year == lastMonth.Year && localTime.Month == lastMonth.Month)
|
||||
return App.Text("Period.LastMonth");
|
||||
|
||||
if (localTime.Year == now.Year || localTime > now.AddMonths(-11))
|
||||
{
|
||||
var diffMonth = (12 + now.Month - localTime.Month) % 12;
|
||||
return App.Text("Period.MonthsAgo", diffMonth);
|
||||
}
|
||||
|
||||
var diffYear = now.Year - localTime.Year;
|
||||
if (diffYear == 1)
|
||||
return App.Text("Period.LastYear");
|
||||
|
||||
return App.Text("Period.YearsAgo", diffYear);
|
||||
}
|
||||
|
||||
private IDisposable _refreshTimer = null;
|
||||
|
|
Loading…
Reference in a new issue