This repository has been archived by the owner on Nov 18, 2024. It is now read-only.
ci: Change release action name #2
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
name: Release App | |
# You may pin to the exact commit or the version. | |
# uses: subosito/flutter-action@48cafc24713cca54bbe03cdc3a423187d413aafa | |
on: | |
push: | |
branches: [ main ] | |
jobs: | |
retrievingVersion: | |
runs-on: ubuntu-latest | |
outputs: | |
version: ${{ steps.versionstep.outputs.version }} | |
previousTag: ${{ steps.previousTag.outputs.previousTag }} | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-tags: true | |
fetch-depth: 0 | |
- name: Expose git commit data | |
uses: rlespinasse/git-commit-data-action@v1 | |
- name: Retrieve Release Version | |
id: versionstep | |
working-directory: sot_richpresence | |
run: | | |
VERSION=$(more pubspec.yaml | grep version: | cut -d ' ' -f2) | |
echo "version=${VERSION}" >> $GITHUB_OUTPUT | |
echo "VERSION=${VERSION}" >> $GITHUB_ENV | |
build_windows: | |
runs-on: windows-latest | |
needs: retrievingVersion | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: subosito/flutter-action@v2 | |
with: | |
flutter-version: '3.19.6' | |
channel: 'stable' | |
- name: Build windows | |
working-directory: ./sot_richpresence | |
run: flutter build windows --build-name ${{ needs.retrievingVersion.outputs.version }} | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: build_windows | |
path: ./sot_richpresence/build/windows/x64/runner/Release | |
build_linux: | |
runs-on: ubuntu-latest | |
needs: retrievingVersion | |
steps: | |
- uses: actions/checkout@v3 | |
- run: | | |
sudo apt-get update -y | |
sudo apt install libmpv-dev mpv | |
sudo apt-get install -y ninja-build libgtk-3-dev | |
- uses: subosito/flutter-action@v2 | |
with: | |
flutter-version: '3.19.6' | |
channel: 'stable' | |
- name: Build linux | |
working-directory: ./sot_richpresence | |
run: flutter build linux --build-name ${{ needs.retrievingVersion.outputs.version }} | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: build_linux | |
path: ./sot_richpresence/build/linux/x64/release/bundle | |
upload: | |
runs-on: ubuntu-latest | |
needs: | |
- build_windows | |
- build_linux | |
- retrievingVersion | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
ref: main | |
- run: mkdir -p dist | |
- uses: actions/download-artifact@v3 | |
with: | |
name: build_windows | |
path: dist/SOT_RichPresence_Windows | |
- uses: actions/download-artifact@v3 | |
with: | |
name: build_linux | |
path: dist/SOT_RichPresence_Linux | |
- name: Zipping windows release | |
working-directory: dist/SOT_RichPresence_Windows | |
run: | | |
zip -r ../../SOT_RichPresence_Windows.zip * | |
- name: Zipping linux release | |
working-directory: dist/SOT_RichPresence_Linux | |
run: | | |
zip -r ../../SOT_RichPresence_Linux.zip * | |
- name: Upload release onto Github | |
uses: ncipollo/release-action@v1 | |
with: | |
artifacts: 'SOT_RichPresence_Windows.zip,SOT_RichPresence_Linux.zip' | |
token: ${{ secrets.GITHUB_TOKEN }} | |
tag: ${{ needs.retrievingVersion.outputs.version }} | |
prerelease: false | |
allowUpdates: true | |