Skip to content

ci: change deploy workflows to workflow_call #12

ci: change deploy workflows to workflow_call

ci: change deploy workflows to workflow_call #12

Workflow file for this run

name: Release
on:
push:
tags:
- "v*"
permissions:
contents: write
jobs:
build:
name: Build ${{ matrix.target }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: ubuntu-latest
target: linux-x64
artifact: simutil-linux-x64
- os: macos-latest
target: macos-x64
artifact: simutil-macos-x64
- os: macos-14
target: macos-arm64
artifact: simutil-macos-arm64
- os: windows-latest
target: windows-x64
artifact: simutil-windows-x64.exe
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Dart
uses: dart-lang/setup-dart@v1
with:
sdk: stable
- name: Install dependencies
run: dart pub get
- name: Build executable
run: dart compile exe bin/simutil.dart -o ${{ matrix.artifact }}
- name: Create archive (Unix)
if: runner.os != 'Windows'
run: |
chmod +x ${{ matrix.artifact }}
tar -czvf simutil-${{ matrix.target }}.tar.gz ${{ matrix.artifact }}
- name: Create archive (Windows)
if: runner.os == 'Windows'
run: |
Compress-Archive -Path ${{ matrix.artifact }} -DestinationPath simutil-${{ matrix.target }}.zip
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: simutil-${{ matrix.target }}
path: simutil-${{ matrix.target }}.${{ runner.os == 'Windows' && 'zip' || 'tar.gz' }}
release:
name: Create Release
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
- name: Generate checksums
run: |
cd artifacts
find . -type f \( -name "*.tar.gz" -o -name "*.zip" \) -exec mv {} . \;
sha256sum *.tar.gz *.zip > checksums.txt
cat checksums.txt
- name: Extract changelog
id: changelog
run: |
VERSION=${GITHUB_REF_NAME#v}
CHANGELOG=$(awk "/^## \[${VERSION}\]/{flag=1; next} /^## \[/{flag=0} flag" CHANGELOG.md)
echo "content<<EOF" >> $GITHUB_OUTPUT
echo "$CHANGELOG" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
body: ${{ steps.changelog.outputs.content }}
generate_release_notes: true
files: |
artifacts/*.tar.gz
artifacts/*.zip
artifacts/checksums.txt
env:
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}
deploy-pub-dev:

Check failure on line 103 in .github/workflows/release.yaml

View workflow run for this annotation

GitHub Actions / Release

Invalid workflow file

The workflow is not valid. .github/workflows/release.yaml (Line: 103, Col: 3): Error calling workflow 'dungngminh/simutil/.github/workflows/deploy-pub-dev.yaml@0ba983249d1d82752a93ddf7e81c21913dd7f596'. The nested job 'publish' is requesting 'id-token: write', but is only allowed 'id-token: none'.
name: Deploy to pub.dev
needs: release
uses: ./.github/workflows/deploy-pub-dev.yaml
secrets: inherit
deploy-homebrew:
name: Deploy to Homebrew
needs: release
uses: ./.github/workflows/deploy-homebrew.yaml
secrets: inherit
deploy-winget:
name: Deploy to WinGet
needs: release
uses: ./.github/workflows/deploy-winget.yaml
secrets: inherit