-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: update build actions before deprecation (#2705)
* remove rust toolchain * update setup-python * update upload release asset Co-authored-by: Jean Ribeiro <[email protected]> * set version * comment out win + mac * incr version * remove mac code * fix updater file * clobber * cleanup uploading to release * test linux * uncomment all OS * incr version * change release name * incr version * use github script * remoe old linux code * fix github script * fix github script * create release script * fix * fix typo * test * fix upload url * log upload path * test * fix return value * revert old changes * revert version --------- Co-authored-by: Jean Ribeiro <[email protected]>
- Loading branch information
1 parent
ca31adb
commit 1729a6f
Showing
2 changed files
with
107 additions
and
109 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -71,116 +71,120 @@ jobs: | |
working-directory: packages/desktop | ||
|
||
- name: Create Release | ||
uses: "actions/github-script@v7" | ||
id: create_release | ||
uses: actions/[email protected] | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
TAG: ${{ github.ref }} | ||
RELEASE_NAME: Bloom Desktop ${{ env.RELEASE_NAME }} | ||
BODY_PATH: packages/desktop/CHANGELOG.md | ||
with: | ||
tag_name: ${{ github.ref }} | ||
release_name: Bloom Desktop ${{ env.RELEASE_NAME }} | ||
body_path: packages/desktop/CHANGELOG.md | ||
draft: true | ||
prerelease: true | ||
|
||
- name: Upload macOS binary asset | ||
uses: actions/upload-release-asset@v1 | ||
github-token: "${{ secrets.GITHUB_TOKEN }}" | ||
result-encoding: string | ||
script: | | ||
const fs = require('fs'); | ||
const { TAG, RELEASE_NAME, BODY_PATH } = process.env; | ||
const tag = TAG.replace('refs/tags/', ''); | ||
const releaseName = RELEASE_NAME.replace('refs/tags/', ''); | ||
const bodyPath = BODY_PATH; | ||
let bodyFileContent = null; | ||
if (bodyPath !== '' && !!bodyPath) { | ||
try { | ||
bodyFileContent = fs.readFileSync(bodyPath, { encoding: 'utf8' }); | ||
} catch (error) { | ||
core.setFailed(error.message); | ||
} | ||
} | ||
|
||
const createReleaseResponse = await github.rest.repos.createRelease({ | ||
tag_name: tag, | ||
name: releaseName, | ||
body: bodyFileContent, | ||
draft: true, | ||
prerelease: true, | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
target_commitish: context.sha | ||
}); | ||
|
||
return createReleaseResponse.data.upload_url; | ||
|
||
- name: Upload Windows assets | ||
uses: "actions/github-script@v7" | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
VERSION: ${{ env.VERSION }} | ||
UPLOAD_URL: ${{ steps.create_release.outputs.result }} | ||
with: | ||
upload_url: ${{ steps.create_release.outputs.upload_url }} | ||
asset_path: assets/bloom-desktop-${{ env.VERSION }}.dmg | ||
asset_name: bloom-desktop-${{ env.VERSION }}.dmg | ||
asset_content_type: application/octet-stream | ||
|
||
- name: Upload macOS blockmap | ||
uses: actions/upload-release-asset@v1 | ||
github-token: "${{ secrets.GITHUB_TOKEN }}" | ||
script: | | ||
const fs = require('fs').promises; | ||
const { VERSION, UPLOAD_URL } = process.env; | ||
const files = [ | ||
`bloom-desktop-${VERSION}.exe`, | ||
`bloom-desktop-${VERSION}.exe.blockmap`, | ||
'latest.yml' | ||
] | ||
for (const file of files) { | ||
await github.rest.repos.uploadReleaseAsset({ | ||
url: UPLOAD_URL, | ||
name: file, | ||
data: await fs.readFile('assets/' + file) | ||
}); | ||
} | ||
|
||
- name: Upload Mac assets | ||
uses: "actions/github-script@v7" | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
VERSION: ${{ env.VERSION }} | ||
UPLOAD_URL: ${{ steps.create_release.outputs.result }} | ||
with: | ||
upload_url: ${{ steps.create_release.outputs.upload_url }} | ||
asset_path: assets/bloom-desktop-${{ env.VERSION }}.dmg.blockmap | ||
asset_name: bloom-desktop-${{ env.VERSION }}.dmg.blockmap | ||
asset_content_type: application/octet-stream | ||
|
||
- name: Upload Windows binary asset | ||
uses: actions/upload-release-asset@v1 | ||
github-token: "${{ secrets.GITHUB_TOKEN }}" | ||
script: | | ||
const fs = require('fs').promises; | ||
const { VERSION, UPLOAD_URL } = process.env; | ||
const files = [ | ||
`bloom-desktop-${VERSION}.dmg`, | ||
`bloom-desktop-${VERSION}.dmg.blockmap`, | ||
`bloom-desktop-${VERSION}.zip`, | ||
'latest-mac.yml' | ||
] | ||
for (const file of files) { | ||
await github.rest.repos.uploadReleaseAsset({ | ||
url: UPLOAD_URL, | ||
name: file, | ||
data: await fs.readFile('assets/' + file) | ||
}); | ||
} | ||
|
||
- name: Upload Linux assets | ||
uses: "actions/github-script@v7" | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
VERSION: ${{ env.VERSION }} | ||
UPLOAD_URL: ${{ steps.create_release.outputs.result }} | ||
with: | ||
upload_url: ${{ steps.create_release.outputs.upload_url }} | ||
asset_path: assets/bloom-desktop-${{ env.VERSION }}.exe | ||
asset_name: bloom-desktop-${{ env.VERSION }}.exe | ||
asset_content_type: application/octet-stream | ||
|
||
- name: Upload Windows blockmap | ||
uses: actions/upload-release-asset@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ steps.create_release.outputs.upload_url }} | ||
asset_path: assets/bloom-desktop-${{ env.VERSION }}.exe.blockmap | ||
asset_name: bloom-desktop-${{ env.VERSION }}.exe.blockmap | ||
asset_content_type: application/octet-stream | ||
|
||
- name: Upload Linux binary asset | ||
uses: actions/upload-release-asset@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ steps.create_release.outputs.upload_url }} | ||
asset_path: assets/bloom-desktop-${{ env.VERSION }}.AppImage | ||
asset_name: bloom-desktop-${{ env.VERSION }}.AppImage | ||
asset_content_type: application/octet-stream | ||
|
||
- name: Upload zip asset | ||
uses: actions/upload-release-asset@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ steps.create_release.outputs.upload_url }} | ||
asset_path: assets/bloom-desktop-${{ env.VERSION }}.zip | ||
asset_name: bloom-desktop-${{ env.VERSION }}.zip | ||
asset_content_type: application/octet-stream | ||
|
||
- name: Upload Linux updater yml | ||
uses: actions/upload-release-asset@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ steps.create_release.outputs.upload_url }} | ||
asset_path: assets/latest-linux.yml | ||
asset_name: latest-linux.yml | ||
asset_content_type: application/octet-stream | ||
|
||
- name: Upload Windows updater yml | ||
uses: actions/upload-release-asset@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ steps.create_release.outputs.upload_url }} | ||
asset_path: assets/latest.yml | ||
asset_name: latest.yml | ||
asset_content_type: application/octet-stream | ||
|
||
- name: Upload MacOs updater yml | ||
uses: actions/upload-release-asset@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ steps.create_release.outputs.upload_url }} | ||
asset_path: assets/latest-mac.yml | ||
asset_name: latest-mac.yml | ||
asset_content_type: application/octet-stream | ||
|
||
- name: Upload Linux code signature asset | ||
uses: actions/upload-release-asset@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ steps.create_release.outputs.upload_url }} | ||
asset_path: assets/bloom-desktop-${{ env.VERSION }}.AppImage.asc | ||
asset_name: bloom-desktop-${{ env.VERSION }}.AppImage.asc | ||
asset_content_type: application/pgp-signature | ||
|
||
github-token: "${{ secrets.GITHUB_TOKEN }}" | ||
script: | | ||
const fs = require('fs').promises; | ||
const { VERSION, UPLOAD_URL } = process.env; | ||
const files = [ | ||
`bloom-desktop-${VERSION}.AppImage`, | ||
`bloom-desktop-${VERSION}.AppImage.asc`, | ||
'latest-linux.yml' | ||
] | ||
for (const file of files) { | ||
await github.rest.repos.uploadReleaseAsset({ | ||
url: UPLOAD_URL, | ||
name: file, | ||
data: await fs.readFile('assets/' + file) | ||
}); | ||
} | ||
|
||
- name: Listing artifacts | ||
run: ls -al |