Skip to content

Commit

Permalink
fix: github actions release flow for windows installers
Browse files Browse the repository at this point in the history
  • Loading branch information
garethgeorge committed Jun 29, 2024
1 parent 15f92fc commit 90e0656
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 25 deletions.
30 changes: 6 additions & 24 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,33 +71,15 @@ jobs:
name: release-artifacts
path: dist

- name: Get Release Artifact URL # used to append installer executables to the release after GoReleaser runs
id: geturl
run: |
upload_url=$(curl -sL https://api.github.com/repos/${{github.repository}}/releases/latest?access_token=${{ secrets.GITHUB_TOKEN }} | jq -r '.upload_url')
echo ::set-output name=upload_url::$upload_url
- name: Generate Installers
run: |
mkdir -p dist-installers
./scripts/generate-installers.sh ./dist-installers
- name: Upload Release Asset x86_64
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.geturl.outputs.upload_url }}
asset_path: ./dist-installers/Backrest-setup-x86_64.exe
asset_name: Backrest-setup-windows-x86_64.exe
asset_content_type: application/octet-stream

- name: Upload Release Asset arm64
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload Assets
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
with:
upload_url: ${{ steps.geturl.outputs.upload_url }}
asset_path: ./dist-installers/Backrest-setup-arm64.exe
asset_name: Backrest-setup-windows-arm64.exe
asset_content_type: application/octet-stream
files: |
./dist-installers/Backrest-setup-x86_64.exe
./dist-installers/Backrest-setup-arm64.exe
2 changes: 1 addition & 1 deletion internal/orchestrator/repo/repo.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ func (r *RepoOrchestrator) Backup(ctx context.Context, plan *v1.Plan, progressCa
defer r.mu.Unlock()

if !r.initialized {
if err := r.repo.Init(ctx, restic.WithEnviron()); err != nil {
if err := r.repo.Init(ctx); err != nil {
return nil, fmt.Errorf("failed to initialize repo: %w", err)
}
r.initialized = true
Expand Down

0 comments on commit 90e0656

Please sign in to comment.