- 
          
 - 
                Notifications
    
You must be signed in to change notification settings  - Fork 58
 
Workflow: Publish Data #980
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
          
     Open
      
      
            lianghai
  wants to merge
  14
  commits into
  unicode-org:main
  
    
      
        
          
  
    
      Choose a base branch
      
     
    
      
        
      
      
        
          
          
        
        
          
            
              
              
              
  
           
        
        
          
            
              
              
           
        
       
     
  
        
          
            
          
            
          
        
       
    
      
from
lianghai:publish-ucd
  
      
      
   
  
    
  
  
  
 
  
      
    base: main
Could not load branches
            
              
  
    Branch not found: {{ refName }}
  
            
                
      Loading
              
            Could not load tags
            
            
              Nothing to show
            
              
  
            
                
      Loading
              
            Are you sure you want to change the base?
            Some commits from the old base branch may be removed from the timeline,
            and old review comments may become outdated.
          
          
  
     Open
                    Changes from 5 commits
      Commits
    
    
            Show all changes
          
          
            14 commits
          
        
        Select commit
          Hold shift + click to select a range
      
      f85bd3f
              
                Workflow for publishing UCD
              
              
                lianghai 4d7cad1
              
                Alpha mode
              
              
                lianghai 97e269c
              
                Revise shell script
              
              
                lianghai 273655e
              
                Customize run-name; try sparse-checkout
              
              
                lianghai 55166cd
              
                Beta mode; organize code
              
              
                lianghai 73c74f1
              
                Flatten control flow
              
              
                lianghai 24bfa68
              
                Reluctantly restore deleted files
              
              
                lianghai a4691eb
              
                Rename workflow files
              
              
                lianghai 03710ab
              
                Workflow renaming, mode → release phase,  dist → TMP=pub/tmp
              
              
                lianghai 607cfa8
              
                Set COPY_YEAR to current year; use UTC time and macOS-compatible format
              
              
                lianghai 5bb2e08
              
                Document Gregg as Rick’s replacement, and existence of publish-data.yml
              
              
                lianghai a6fc78e
              
                Use the [[ syntax in place of [
              
              
                lianghai 7004cd7
              
                Correct $TMP creation
              
              
                lianghai 3212a18
              
                Merge branch 'main' into publish-ucd
              
              
                lianghai File filter
Filter by extension
Conversations
          Failed to load comments.   
        
        
          
      Loading
        
  Jump to
        
          Jump to file
        
      
      
          Failed to load files.   
        
        
          
      Loading
        
  Diff view
Diff view
There are no files selected for viewing
  
    
      This file contains hidden or 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 | 
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| # See publish-ucd.yml | ||
| 
     | 
||
| mkdir dist | ||
| 
     | 
||
| PUB_DATE=$(date --iso-8601) | ||
| 
     | 
||
| cat > dist/sed-readmes.txt << eof | ||
| s/COPY_YEAR/$COPY_YEAR/ | ||
| s/PUB_DATE/$PUB_DATE/ | ||
| s/PUB_STATUS/draft/ | ||
| s/UNI_VER/$UNI_VER/ | ||
| s/EMOJI_VER/$EMOJI_VER/ | ||
| s/TR10_REV/$TR10_REV/ | ||
| s%PUBLIC_EMOJI%Public/draft/emoji% | ||
| s%PUBLIC_UCD%Public/draft/UCD% | ||
| eof | ||
| 
     | 
||
| mkdir dist/UCD | ||
| cp -R unicodetools/data/ucd/dev dist/UCD/ucd | ||
| mv dist/UCD/ucd/version-ReadMe.txt dist/UCD/ReadMe.txt | ||
| rm -r dist/UCD/ucd/Unihan | ||
| if [ "$MODE" = "Snapshot" ]; then | ||
| rm -r dist/UCD/ucd/emoji | ||
| fi | ||
| 
     | 
||
| if [ "$MODE" = "Alpha" ] || [ "$MODE" = "Beta" ]; then | ||
| cp -R unicodetools/data/emoji/dev dist/emoji | ||
| 
     | 
||
| cp -R unicodetools/data/idna/dev dist/idna | ||
| 
     | 
||
| mkdir dist/idna2008derived | ||
| cp unicodetools/data/idna/idna2008derived/ReadMe.txt dist/idna2008derived | ||
| cp unicodetools/data/idna/idna2008derived/Idna2008-$UNI_VER.txt dist/idna2008derived | ||
| 
     | 
||
| if [ "$MODE" = "Beta" ]; then | ||
| cp -R unicodetools/data/uca/dev dist/UCA | ||
| sed -i -f dist/sed-readmes.txt dist/UCA/CollationTest.html | ||
| 
     | 
||
| cp -R unicodetools/data/security/dev dist/security | ||
| fi | ||
| fi | ||
| 
     | 
||
| # Update the readmes in-place (-i) as set up above. | ||
| find dist -name '*ReadMe.txt' | xargs sed -i -f dist/sed-readmes.txt | ||
| rm dist/sed-readmes.txt | ||
| 
     | 
||
| mkdir dist/zipped | ||
| mv dist/UCD/ucd/zipped-ReadMe.txt dist/zipped/ReadMe.txt | ||
| (cd dist/UCD/ucd; zip -r UCD.zip *) | ||
| mv dist/UCD/ucd/UCD.zip dist/zipped | ||
| 
     | 
||
| if [ "$MODE" = "Beta" ]; then | ||
| (cd dist/UCA; zip -r CollationTest.zip CollationTest; rm -r CollationTest) | ||
| 
     | 
||
| (cd dist/security; zip -r uts39-data-$UNI_VER.zip *) | ||
| fi | ||
  
    
      This file contains hidden or 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 | 
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| # See https://github.com/unicode-org/unicodetools/blob/main/docs/data-workflow.md#publication | ||
| 
     | 
||
| # Test locally with https://github.com/nektos/act: | ||
| # act --workflows .github/workflows/publish-ucd.yml --input mode=Alpha | ||
| 
     | 
||
| name: Publish UCD | ||
| 
     | 
||
| run-name: "${{ github.workflow }}: ${{ inputs.mode }}" | ||
| 
     | 
||
| on: | ||
| workflow_dispatch: | ||
| inputs: | ||
| mode: | ||
| description: Publication mode | ||
| type: choice | ||
| options: | ||
| - Snapshot | ||
| - Alpha | ||
| - Beta | ||
| default: Snapshot | ||
| 
     | 
||
| env: | ||
| COPY_YEAR: "2024" | ||
| UNI_VER: "17.0.0" | ||
| EMOJI_VER: "17.0" | ||
| TR10_REV: "tr10-52" # UTS #10 release revision number to be used in CollationTest.html: One more than the last release revision number. | ||
| MODE: ${{ inputs.mode }} | ||
| 
     | 
||
| jobs: | ||
| build: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| with: | ||
| sparse-checkout: | | ||
| .github/workflows | ||
| unicodetools/data/ucd/dev | ||
| unicodetools/data/emoji/dev | ||
| unicodetools/data/idna/dev | ||
| unicodetools/data/idna/idna2008derived | ||
| - run: .github/workflows/publish-ucd.sh | ||
| - uses: actions/upload-artifact@v4 | ||
| with: | ||
| path: dist | 
This file was deleted.
      
      Oops, something went wrong.
      
    
  This file was deleted.
      
      Oops, something went wrong.
      
    
  This file was deleted.
      
      Oops, something went wrong.
      
    
  
      
      Oops, something went wrong.
        
    
  
  Add this suggestion to a batch that can be applied as a single commit.
  This suggestion is invalid because no changes were made to the code.
  Suggestions cannot be applied while the pull request is closed.
  Suggestions cannot be applied while viewing a subset of changes.
  Only one suggestion per line can be applied in a batch.
  Add this suggestion to a batch that can be applied as a single commit.
  Applying suggestions on deleted lines is not supported.
  You must change the existing code in this line in order to create a valid suggestion.
  Outdated suggestions cannot be applied.
  This suggestion has been applied or marked resolved.
  Suggestions cannot be applied from pending reviews.
  Suggestions cannot be applied on multi-line comments.
  Suggestions cannot be applied while the pull request is queued to merge.
  Suggestion cannot be applied right now. Please check back later.
  
    
  
    
Uh oh!
There was an error while loading. Please reload this page.