Skip to content

Commit

Permalink
Bump to v1.0.0 (#12)
Browse files Browse the repository at this point in the history
  • Loading branch information
MareMare authored Sep 13, 2022
1 parent e3235b3 commit b3d3114
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 25 deletions.
32 changes: 8 additions & 24 deletions .github/workflows/create-release-and-upload-asset.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,19 +32,13 @@ jobs:
working-directory: src
run: dotnet build --configuration Release --no-restore

- name: 🚀 Publish BackupSqlDatabase
- name: 🚀 Publish
shell: pwsh
run: |
dotnet publish .\src\BackupSqlDatabase\BackupSqlDatabase.csproj --configuration Release --output out\BackupSqlDatabase --runtime win-x64 --self-contained true
rm out\BackupSqlDatabase\*.pdb
Compress-Archive -Path "out\BackupSqlDatabase\*.*" -DestinationPath "out\BackupSqlDatabase-win-x64.zip"
- name: 🚀 Publish RestoreSqlDatabase
shell: pwsh
run: |
dotnet publish .\src\RestoreSqlDatabase\RestoreSqlDatabase.csproj --configuration Release --output out\RestoreSqlDatabase --runtime win-x64 --self-contained true
rm out\RestoreSqlDatabase\*.pdb
Compress-Archive -Path "out\RestoreSqlDatabase\*.*" -DestinationPath "out\RestoreSqlDatabase-win-x64.zip"
dotnet publish .\src\BackupSqlDatabase\BackupSqlDatabase.csproj --configuration Release --output out --runtime win-x64 --self-contained true
dotnet publish .\src\RestoreSqlDatabase\RestoreSqlDatabase.csproj --configuration Release --output out --runtime win-x64 --self-contained true
rm out\*.pdb
Compress-Archive -Path "out\*.*" -DestinationPath "out\DbBackupRestore-win-x64.zip"
- name: 📝 Create Release
id: create_release
Expand All @@ -59,22 +53,12 @@ jobs:
draft: true
prerelease: true

- name: 🚢 Upload BackupSqlDatabase Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: out\BackupSqlDatabase-win-x64.zip
asset_name: BackupSqlDatabase-win-x64.zip
asset_content_type: application/zip

- name: 🚢 Upload RestoreSqlDatabase Release Asset
- name: 🚢 Upload Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: out\RestoreSqlDatabase-win-x64.zip
asset_name: RestoreSqlDatabase-win-x64.zip
asset_path: out\DbBackupRestore-win-x64.zip
asset_name: DbBackupRestore-win-x64.zip
asset_content_type: application/zip
26 changes: 26 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,17 @@ SQL Server データベースの完全バックアップ、および新しい場
```ps1
.\BackupSqlDatabase.exe
```
* 実行されるSQL例
```sql
BACKUP DATABASE @databaseName
TO DISK = @backupFilePath WITH NOFORMAT
, NAME = @description
, INIT
, SKIP
, NOREWIND
, NOUNLOAD
, STATS = 10;
```

## データベースの新しい場所への復元

Expand All @@ -19,6 +30,21 @@ SQL Server データベースの完全バックアップ、および新しい場
```ps1
.\RestoreSqlDatabase.exe
```
* 実行されるSQL例
```sql
RESTORE FILELISTONLY FROM DISK = @backupFilePath;
ALTER DATABASE @databaseName SET OFFLINE WITH ROLLBACK IMMEDIATE;
RESTORE DATABASE @databaseName
FROM DISK = @backupFilePath WITH REPLACE
, NOUNLOAD
, STATS = 5
, MOVE N'{logicalName1}' TO N'{moveToFilePath1}'
, MOVE N'{logicalName2}' TO N'{moveToFilePath2}';
ALTER DATABASE @databaseName SET ONLINE;
```

## バックアップ先と復元先フォルダのアクセス権について
バックアップ先と復元先フォルダには SQL Server に対してアクセス許可を与える必要があります。
Expand Down
2 changes: 1 addition & 1 deletion src/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

<!-- ソリューションに含まれるすべてのプロジェクトに共通のバージョンを設定します。-->
<PropertyGroup>
<Version>0.0.1</Version>
<Version>1.0.0</Version>
</PropertyGroup>

<!-- カスタムプロパティ -->
Expand Down

0 comments on commit b3d3114

Please sign in to comment.